Package org.cristalise.kernel.process
Class Gateway
java.lang.Object
org.cristalise.kernel.entity.proxy.ProxyManager
org.cristalise.kernel.process.Gateway
The Gateway is the central object of a CRISTAL process. It initializes,
maintains and shuts down every other subsystem in both the client and the
server.
Child objects:
- Lookup - Provides access to the CRISTAL directory. Find or search for Items or Agents.
- ProxyManager - Gives a local proxy object for Entities found in the directory. Execute activities in Items, query or subscribe to Entity data.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose()Shuts down all kernel API objectsstatic voidconnect()Connects to the Lookup server in an administrative context.static AgentProxyLog in with the given username and password, and initialises theLookupandProxyManager.static AgentProxyLog in with the given username and password, and initialises theLookupandProxyManager.static voidstatic Stringstatic Stringstatic Lookupstatic LookupManagerstatic CastorXMLUtilitystatic ModuleManagerStatic getter for ModuleManagerstatic ObjectPropertiesstatic ProxyManagerDeprecated.static ResourceLoaderstatic ResourceImportHandlergetResourceImportHandler(String resType) Deprecated.static ResourceImportHandlergetResourceImportHandler(BuiltInResources resType) Retrieves the ResourceImportHandler available for the resource type.static SecurityManagerstatic ClusterStorageManagerstatic io.vertx.core.VertxgetVertx()static voidinit(Properties props) Initialises the Gateway and all of the client objects it holds, with the exception of the Lookup, which is initialised during connect()static voidinit(Properties props, ResourceLoader res) Initialises the Gateway and all of the client objects it holds, with the exception of the Lookup, which is initialised during connect()static Enumeration<?> static voidRun the different kind of Boostrap processesstatic voidsendProxyEvent(Set<ProxyMessage> messages) Send a Set of ProxyMessages to the subscribersstatic voidsendProxyEvent(ProxyMessage message) Send a single ProxyMessage to the subscribersstatic voidMakes this process capable of creating and managing server entities.Methods inherited from class org.cristalise.kernel.entity.proxy.ProxyManager
getAgentProxy, getAgentProxy, getAgentProxy, getAgentProxy, getProxy, getProxy
-
Method Details
-
init
Initialises the Gateway and all of the client objects it holds, with the exception of the Lookup, which is initialised during connect()- Parameters:
props- - java.util.Properties containing all application properties. If null, the java system properties are used- Throws:
InvalidDataException- - invalid properties caused a failure in initialisation
-
init
Initialises the Gateway and all of the client objects it holds, with the exception of the Lookup, which is initialised during connect()- Parameters:
props- - java.util.Properties containing all application properties. If null, the java system properties are usedres- - ResourceLoader for the kernel to use to resolve all class resource requests such as for bootstrap descriptions and version information- Throws:
InvalidDataException- - invalid properties caused a failure in initialisation
-
startServer
Makes this process capable of creating and managing server entities. Runs the Creates the LookupManager, ProxyServer, initialises the vertx services -
getModuleManager
Static getter for ModuleManager- Returns:
- ModuleManager
-
connect
Connects to the Lookup server in an administrative context. It shall be used in server processes only.- Throws:
InvalidDataException- - bad paramsPersistencyException- - error starting storagesObjectNotFoundException- - object not foundCriseVertxException
-
connect
Log in with the given username and password, and initialises theLookupandProxyManager. It shall be used in client processes only.- Parameters:
agentName- - usernameagentPassword- - password- Returns:
- an AgentProxy on the requested user
- Throws:
InvalidDataException- - bad paramsPersistencyException- - error starting storagesObjectNotFoundException- - object not foundCriseVertxException
-
connect
public static AgentProxy connect(String agentName, String agentPassword, String resource) throws CriseVertxException Log in with the given username and password, and initialises theLookupandProxyManager. It shall be uses in client processes only.- Parameters:
agentName- - usernameagentPassword- - passwordresource- - resource- Returns:
- an AgentProxy on the requested user
- Throws:
InvalidDataException- - bad paramsPersistencyException- - error starting storagesObjectNotFoundException- - object not foundCriseVertxException
-
close
public static void close()Shuts down all kernel API objects -
getSecurityManager
-
getLookup
-
getLookupManager
- Throws:
CannotManageException
-
getVertx
public static io.vertx.core.Vertx getVertx() -
getStorage
-
getMarshaller
-
getResource
-
getProxyManager
Deprecated.use static getProxy(...) methods ofGateway- Returns:
- the instance of
ProxyManager
-
getCentreId
-
propertyNames
-
dumpC2KProps
public static void dumpC2KProps() -
getProperties
-
getKernelVersion
-
getResourceImportHandler
@Deprecated public static ResourceImportHandler getResourceImportHandler(String resType) throws Exception Deprecated.Retrieves the ResourceImportHandler available for the resource type. It creates a new if configured or falls back to the default one provided in the kernel- Parameters:
resType- the type o the Resource. ie. one of these values: OD/SC/SM/EA/CA/QL- Returns:
- the initialised ResourceImportHandler
- Throws:
Exception
-
getResourceImportHandler
public static ResourceImportHandler getResourceImportHandler(BuiltInResources resType) throws Exception Retrieves the ResourceImportHandler available for the resource type. It creates a new if configured or falls back to the default one provided in the kernel- Parameters:
resType- the type o the Resource- Returns:
- the initialised ResourceImportHandler
- Throws:
Exception
-
runBoostrap
Run the different kind of Boostrap processes- Throws:
Exception- anything could happen
-
sendProxyEvent
Send a single ProxyMessage to the subscribers- Parameters:
message- the be sent
-
sendProxyEvent
Send a Set of ProxyMessages to the subscribers- Parameters:
messages-
-
Gateway