Class MetadataProviderServer
java.lang.Object
com.lightstreamer.adapters.remote.Server
com.lightstreamer.adapters.remote.MetadataProviderServer
A Remote Server object which can run a Remote Metadata Adapter and connect it
to a Proxy Metadata Adapter running on Lightstreamer Server.
The object should be provided with a MetadataProvider instance and with suitable local initialization parameters and established connections, then activated through
By default, the invocations to the Metadata Adapter methods will be done in an unlimited thread pool. A thread pool maximum size can be specified through the custom "lightstreamer.metadata.pool.size" system property. A size of 1 enforces strictly sequential invocations and can be used if parallelization of the calls is not supported by the Metadata Adapter. A size of 0 or negative also implies an unlimited thread pool.
Note that requests with an implicit ordering, like notifyNewSession and NotifySessionClose for the same session, are always guaranteed to be sequentialized in the right way, although they may not occur in the same thread.
The object should be provided with a MetadataProvider instance and with suitable local initialization parameters and established connections, then activated through
Server.start()
and finally disposed through Server.close()
.
If any preliminary initialization on the supplied MetadataProvider
implementation object has to be performed, it should be done through
a custom, dedicated method before invoking Server.start()
.
Further reuse of the same instance is not supported. By default, the invocations to the Metadata Adapter methods will be done in an unlimited thread pool. A thread pool maximum size can be specified through the custom "lightstreamer.metadata.pool.size" system property. A size of 1 enforces strictly sequential invocations and can be used if parallelization of the calls is not supported by the Metadata Adapter. A size of 0 or negative also implies an unlimited thread pool.
Note that requests with an implicit ordering, like notifyNewSession and NotifySessionClose for the same session, are always guaranteed to be sequentialized in the right way, although they may not occur in the same thread.
-
Constructor Summary
ConstructorDescriptionCreates an empty server still to be configured and started. -
Method Summary
Modifier and TypeMethodDescriptionfinal MetadataProvider
Gets the configured Metadata Adapter that is running or will run.final String
Gets the pathname of an optional configuration file for the Remote Metadata Adapter, to be passed to the init method.Gets the Map object to be passed to the init method of the Remote Metadata Adapter, to supply optional parameters.final void
setAdapter
(MetadataProvider adapter) Sets the Remote Metadata Adapter instance to be run.final void
setAdapterConfig
(String configFile) Sets the pathname of an optional configuration file for the Remote Metadata Adapter, to be passed to the init method.final void
setAdapterParams
(Map<String, String> params) Sets a Map object to be passed to the init method of the Remote Metadata Adapter, to supply optional parameters.Methods inherited from class com.lightstreamer.adapters.remote.Server
close, getExceptionHandler, getName, getRemotePassword, getRemoteUser, getReplyStream, getRequestStream, setExceptionHandler, setLoggerProvider, setName, setRemotePassword, setRemoteUser, setReplyStream, setRequestStream, start
-
Constructor Details
-
MetadataProviderServer
public MetadataProviderServer()Creates an empty server still to be configured and started. The Init method of the Remote Adapter will be invoked only upon a Proxy Adapter request.- Throws:
IllegalArgumentException
- in case something wrong is supplied in system properties related with Metadata Adapter processing.
-
-
Method Details
-
setAdapter
Sets the Remote Metadata Adapter instance to be run.- Parameters:
adapter
- the Remote Metadata Adapter instance to be run.
-
getAdapter
Gets the configured Metadata Adapter that is running or will run.- Returns:
- the configured Metadata Adapter
-
setAdapterParams
Sets a Map object to be passed to the init method of the Remote Metadata Adapter, to supply optional parameters.
The default value is an empty HashMap.- Parameters:
params
- the Map to be passed to the init method of the Remote Metadata Adapter- See Also:
-
getAdapterParams
Gets the Map object to be passed to the init method of the Remote Metadata Adapter, to supply optional parameters.
The default value is an empty HashMap.- Returns:
- the Map object to be passed to the init method of the Remote Metadata Adapter
- See Also:
-
setAdapterConfig
Sets the pathname of an optional configuration file for the Remote Metadata Adapter, to be passed to the init method.
The default value is null.- Parameters:
configFile
- the pathname of an optional configuration file for the Remote Metadata Adapter.- See Also:
-
getAdapterConfig
Gets the pathname of an optional configuration file for the Remote Metadata Adapter, to be passed to the init method.
The default value is null.- Returns:
- the pathname of an optional configuration file for the Remote Metadata Adapter
- See Also:
-