|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ogf.graap.wsag.server.engine.WsagEngine
public class WsagEngine
The WSAGEngine provides access to all agreement factories configured for this engine. The available
factories can be retrieved via the agreement factory home interface. The agreement factory home is
retrieved by the #getAgreementFactoryHome()
method. Before the engine can be used it must be
initialized. Engine initialization is triggered by the #initializeEngine(String)
method.
Field Summary | |
---|---|
protected List<PersistentAgreementFactory> |
factoriesOL
An ordered list with the available agreement factories. |
protected Map<String,PersistentAgreementFactory> |
persistentFactories
A map that contains the available persistent agreement factory which are identified by their factory id. |
Method Summary | |
---|---|
PersistentAgreementFactory |
find(String factoryId)
looks up a factory with the given id. |
IAgreementFactory |
getAgreementFactoryPrototype()
Instantiates a new agreement factory instance based on the engine configuration. |
WSAG4JEngineConfigurationType |
getConfiguration()
Returns the configuration for this engine instance. |
String |
getDefaultResourceId()
Returns the resource id configured for this engine instance or the a generated UUID if not set. |
static WsagEngine |
getInstance(InputStream configuration)
Returns a new WSAG engine instance. |
static WsagEngine |
getInstance(String configFile)
Returns a new WSAG engine instance. |
static WsagEngine |
getInstance(WSAG4JEngineConfigurationType engineConfiguration)
Returns a new WSAG engine instance. |
IAgreementFactoryHome |
getPersistenceLayer()
Returns the persistence layer for this engine. |
PersistentAgreementFactory[] |
list()
Lists all agreement factories. |
void |
remove(String factoryId)
Removes the factory with the given ID. |
void |
save()
Saves all factories. |
void |
saveAgreementFactories(PersistentAgreementFactory[] factories)
|
void |
shutdown()
Shutdown of the WSAG4J engine instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<String,PersistentAgreementFactory> persistentFactories
protected List<PersistentAgreementFactory> factoriesOL
Method Detail |
---|
public static WsagEngine getInstance(InputStream configuration) throws EngineInstantiationException
configuration
- engine configuration as input stream
EngineInstantiationException
- failed to instantiate the enginepublic static WsagEngine getInstance(String configFile) throws EngineInstantiationException
configFile
- engine configuration as file name (must be available in the class path)
EngineInstantiationException
- failed to instantiate the enginepublic static WsagEngine getInstance(WSAG4JEngineConfigurationType engineConfiguration) throws EngineInstantiationException
engineConfiguration
- engine configuration
EngineInstantiationException
- failed to instantiate the enginepublic PersistentAgreementFactory find(String factoryId) throws Exception
find
in interface IAgreementFactoryHome
factoryId
- the id of the factory to find
Exception
- an error occurred while looking up the factory.IAgreementFactoryHome.find(String)
public IAgreementFactory getAgreementFactoryPrototype() throws Exception
configuration
- Configuration of the wsag4j engine.
Exception
- failed to initialize the configured factorypublic WSAG4JEngineConfigurationType getConfiguration()
public String getDefaultResourceId()
public IAgreementFactoryHome getPersistenceLayer()
public PersistentAgreementFactory[] list() throws Exception
IAgreementFactoryHome
list
in interface IAgreementFactoryHome
Exception
- indicates an error while generating the factory listIAgreementFactoryHome.list()
public void remove(String factoryId) throws Exception
IAgreementFactoryHome
remove
in interface IAgreementFactoryHome
factoryId
- removes the factory with the given id from the persistence layer
Exception
- an error occurred while removing the factoryIAgreementFactoryHome.remove(java.lang.String)
public void save() throws Exception
Exception
- indicates an error while saving the factoriespublic void saveAgreementFactories(PersistentAgreementFactory[] factories) throws Exception
saveAgreementFactories
in interface IAgreementFactoryHome
factories
- the factories to save
Exception
- indicates an error while saving the factoriesIAgreementFactoryHome.saveAgreementFactories(org.ogf.graap.wsag.server.persistence.PersistentAgreementFactory[])
public void shutdown() throws Exception
Exception
- indicates an error during engine shutdown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |