|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.omsdk.commons.OMSDKConnector
Entry point for the Open Media SDKs. Use this class to connect your application to servers, then to initialize your MIL or QIL factory.
Before connecting, first fill in an InitializationParameters
object with connection parameters
(port, host, and so on.) To create this object, specify InitializationServices
according to the
Java library to be connected: MIL or QIL.
The following code snippet creates an InitializationParameters
object, using
the InitializationServices
available through the
com.genesyslab.omsdk.mil.MILFactory
class.
InitializationServices milInitServices = MILFactory.getInitializationServices();
InitializationParameters ip = new InitializationParameters(
"ConfigServerPrimaryHost",
"ConfigServerPrimaryPort",
"back up port",
"back up host",
"ApplicationName",
data.getReconnectionPeriod(),
data.getReconnectionAttempts());
ip.addInitializationServices(milInitServices);
To connect, initialize the OM library by calling the OMSDKConnector.initialize()
static method, as shown in
the following code snippet.
OMSDKConnector.initialize(ip);
Then retrieve an instance to access open media common features.
OMSDKConnector connector = OMSDKConnector.getInstance();
Method Summary | |
static void |
addServiceListener(ServiceListener listener,
ServiceType type)
Adds a ServiceListener to the listener list for a specific type
of internal service. |
abstract ApplicationInfo |
getApplicationInfo()
Returns an ApplicationInfo object that contains the Configuration Layer's
information about the current application. |
static OMSDKConnector |
getInstance()
Returns the OMSDKConnector instance. |
abstract ServiceInfo |
getServiceInfo(ServiceType type)
Returns the ServiceInfo associated with the specified service type. |
abstract java.util.Set |
getServices()
Returns the services. |
static void |
initialize(InitializationParameters ip)
Initializes the OMSDKConnector instance with the specified
initialization parameters. |
static boolean |
isShutdownHookEnabled()
Returns the current status of the integrated shutdown hook. |
static void |
release()
Releases this instance and all the objects made available through this interface. |
static void |
removeServiceListener(ServiceListener listener,
ServiceType type)
Removes the specified ServiceListener from the listener list for a specific type
of internal service. |
static void |
setShutdownHookEnabled(boolean enabled)
Controls the usage of the integrated shutdown hook. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static OMSDKConnector getInstance()
OMSDKConnector
instance.
OMSDKConnector
instance.public static void initialize(InitializationParameters ip) throws InitializationException
OMSDKConnector
instance with the specified
initialization parameters.
If the OMSDKConnector
is already initialized:
ip
- initialization parameters
InitializationException
- exception thrown if some internal service failed to initialize, or if initialization parameters are incorrectpublic static void release()
public abstract ServiceInfo getServiceInfo(ServiceType type) throws ServiceException
ServiceInfo
associated with the specified service type.
type
- the service type.
ServiceInfo
associated with the service type.
ServiceException
- exception
thrown if the ServiceInfo
cannot be retrieved, due to an internal error.public abstract java.util.Set getServices() throws ServiceException
Set
of ServiceType
items.
ServiceException
- thrown if problems occured during information retrievalpublic abstract ApplicationInfo getApplicationInfo() throws ServiceException
ApplicationInfo
object that contains the Configuration Layer's
information about the current application.
ServiceException
- thrown if the request failed. To get specific reasons for this error,
see the subclasses of RequestFailedException
.InitializationParameters.getApplicationName()
public static void setShutdownHookEnabled(boolean enabled)
If the shutdown hook is disabled, the user application should handle emergency shutdown.
enabled
- true
to enable the shutdown hook, false
to disable it.public static boolean isShutdownHookEnabled()
true
if the shutdown hook is enabled.public static void addServiceListener(ServiceListener listener, ServiceType type)
ServiceListener
to the listener list for a specific type
of internal service.
listener
- the listener to be added.type
- the service type to add the listener to.public static void removeServiceListener(ServiceListener listener, ServiceType type)
ServiceListener
from the listener list for a specific type
of internal service.
listener
- the listener to be removed.type
- the service type from which to remove the listener.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |