com.sourceforge.jpatterns.core
Interface IJPEngine

All Known Implementing Classes:
JPEngineImpl

public interface IJPEngine

It is an entry point for all the operations with JPatterns framework from the side of the consumer of this framework. This interface defines the methods which would be useful for working with the JPattern. Usually only this class would be used. The implementation of this interface could be customized (study appropriate documentation on the customization).
The methods are represented here would return the implementations of the certain patterns: e.g. IFactory, IChain etc. Also they could return some additional stuff.
Please access this functionality using JPEngineFactory - it is the only entry point for working with implementations of IJPEngine interface.
All the stuff of the JPatterns configuration would be initialized at the static initialization so just access this class trough the appropriate factory. todo [zmicer]: method for the global configuration to be put here. note [zmicer]: be noticed this interface and the implementation are used for both consumer and framework specific operations.

$Author:: zmicer $
$Rev:: 67 $
* $Date:: 2007-08-28 21:37:07 #$
$Date:: 2007-08-28 21:37:07 #$


Method Summary
 JPConstants.EngineConfigCaregory getCategory()
           
 IJPConfig getConfig(String configName, String scope)
          Get the config pattern
 IJPFactory getFactory(String factoryName, String scope)
          Get the IJPFactory using the provided name and the scope.
 IJPattern getPattern(String patternName, String scope)
          Get the IJPattern using the provided name and the scope.
 void init(JPConstants.EngineConfigCaregory category)
          Set the JPatterns engine category type - it could be consumer, framework related etc.
 boolean isInitialized()
           
 

Method Detail

init

void init(JPConstants.EngineConfigCaregory category)
Set the JPatterns engine category type - it could be consumer, framework related etc. It defines the purposes it would be used.

Parameters:
category - instance of JPConstants.EngineConfigCaregory, Can not be null (otherwise IllegalArgumentException would appear).

getCategory

JPConstants.EngineConfigCaregory getCategory()
Returns:
the JPatterns engine category. In the case it is not initialized - null would be returned

isInitialized

boolean isInitialized()
Returns:
true if the instance is initialized, false otherwise. For now the presence of the category set only influence on this, but in the future it could be changed

getFactory

IJPFactory getFactory(String factoryName,
                      String scope)
Get the IJPFactory using the provided name and the scope. Please be noticed in the case the scope is not specified the following constant is used as the scope id: (com.sourceforge.jpatterns.core.JPConstants.DEFAULT_SCOPE_NAME)
Please be noticed that the factory returned using the provided scope name, may contains the items(implementation mappings) different then this scope provided. It takes place in the case when the factory has the default scope, and has the items with different scopes - all of them would be accesible through this factory (having the different scope).
Throws JPInitializationException in the case it is not initialized

Parameters:
factoryName - the name of the factory to be retrieved. Can not be null (otherwise IllegalArgumentException would appear).
scope - scope name to be used for the retrieving of the appropriate factory. Could be null, in the case the default scope would be used.
Returns:
the IJPFactory instance to be used later.

getPattern

IJPattern getPattern(String patternName,
                     String scope)
Get the IJPattern using the provided name and the scope. Please be noticed in the case the scope is not specified the following constant is used as the scope id: (com.sourceforge.jpatterns.core.JPConstants.DEFAULT_SCOPE_NAME)
Be noticed that the pattern returned using the provided scope name, may contains the items(implementation mappings) different then this scope provided.
Throws JPInitializationException in the case it is not initialized

Parameters:
patternName - the name of the pattern to be retrieved. Can not be null (otherwise IllegalArgumentException would appear).
scope - scope name to be used for the retrieving of the appropriate pattern. Could be null, in the case the default scope would be used.
Returns:
the IJPattern instance to be used later.

getConfig

IJPConfig getConfig(String configName,
                    String scope)
Get the config pattern

Parameters:
configName - the name of the config pattern, Can not be null (otherwise IllegalArgumentException would appear).
scope - the name of the config scope, Can not be null (otherwise IllegalArgumentException would appear).
Returns:
the IJPConfig instance.


Copyright © 2007 jzmicer.team. All Rights Reserved.