|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.root.RootObject
com.neeve.emx.EmxObject
com.neeve.emx.EmxFactory
public final class EmxFactory
Factory class used to create EMX dispatchers, events and network link endpoints.
This class is a singleton class used to create dispatcher, event and link endpoint objects. Since there can be several deployed EMX implementations, the user should always use the factory to instantiate EMX objects. The factory isolates the user from the actual implementation.
Nested Class Summary | |
---|---|
static class |
EmxFactory.EmxImpl
EMX implementations. |
Method Summary | |
---|---|
IEmxAlarmEvent |
createAlarmEvent(EmxFactory.EmxImpl impl,
IEmxEventHandler handler,
int interval)
Create an EMX alarm event. |
IEmxDispatcher |
createDispatcher(EmxFactory.EmxImpl impl,
String name,
IEmxDispatcher.Params params)
Create an EMX dispatcher. |
IEmxNwLnkClientEndpoint |
createNwLnkClientEndpoint(EmxFactory.EmxImpl impl,
String descriptorStr,
HashMap<String,Object> props)
Create an EMX network link client endpoint. |
IEmxNwLnkClientEndpoint |
createNwLnkClientEndpoint(EmxFactory.EmxImpl impl,
com.neeve.util.UtlAddressDescriptor descriptor)
Create an EMX network link client endpoint. |
IEmxNwLnkEndpoint |
createNwLnkEndpoint(boolean client,
EmxFactory.EmxImpl impl,
String descriptorStr,
HashMap<String,Object> props)
Create an EMX network link client or server endpoint. |
IEmxNwLnkEndpoint |
createNwLnkEndpoint(boolean client,
EmxFactory.EmxImpl impl,
com.neeve.util.UtlAddressDescriptor descriptor)
Create an EMX network link client or server endpoint. |
IEmxNwLnkServerEndpoint |
createNwLnkServerEndpoint(EmxFactory.EmxImpl impl,
String descriptorStr,
HashMap<String,Object> props)
Create an EMX network link server endpoint. |
IEmxNwLnkServerEndpoint |
createNwLnkServerEndpoint(EmxFactory.EmxImpl impl,
com.neeve.util.UtlAddressDescriptor descriptor)
Create an EMX network link server endpoint. |
IEmxUserEvent |
createUserEvent(EmxFactory.EmxImpl impl,
IEmxEventHandler handler)
Create an EMX user event. |
EmxFactory.EmxImpl |
getDefaultEmxImpl()
Return the default EMX implementation configured for use. |
static EmxFactory |
getInstance()
Return the singleton EMX factory instance |
Methods inherited from class com.neeve.root.RootObject |
---|
getChecked, getThreaded, getTracer, setChecked, setTracer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static EmxFactory getInstance()
public final EmxFactory.EmxImpl getDefaultEmxImpl()
This method returns the default EMX implementation configured for use.
The default implementation is retrieved from the nv.emx.impl
system property. In case the system property is not set, the default
impl defaults to EmxFactory.EmxImpl.NIO
public final IEmxDispatcher createDispatcher(EmxFactory.EmxImpl impl, String name, IEmxDispatcher.Params params) throws EEmxException
impl
- The EMX implementation to use. Refer to EmxFactory.EmxImpl
for
supported EMX implementations.name
- The name to be assigned to the dispatcher. This name is only
use for debugging and trace purposes.params
- Specifies operational parameters to be used by the created
dispatcher.
EEmxException
- Thrown if any other exception was encountered
while creating the dispatcher.public final IEmxUserEvent createUserEvent(EmxFactory.EmxImpl impl, IEmxEventHandler handler)
impl
- The EMX implementation to use. Refer to EmxFactory.EmxImpl
for
supported EMX implementations.handler
- The handler to be associate with the event.
This method creates an EMX user event.
public final IEmxAlarmEvent createAlarmEvent(EmxFactory.EmxImpl impl, IEmxEventHandler handler, int interval)
impl
- The EMX implementation to use. Refer to EmxFactory.EmxImpl
for
supported EMX implementations.handler
- The handler to be associate with the event.interval
- The alarm interval (in milliseconds).
This method creates an EMX alarm event.
public final IEmxNwLnkEndpoint createNwLnkEndpoint(boolean client, EmxFactory.EmxImpl impl, com.neeve.util.UtlAddressDescriptor descriptor) throws EEmxNwLnkInvalidTypeException, EEmxException
client
- A value of true in this parameter will create a client
endpoint and a value of false will create a server endpoint.impl
- The EMX implementation to use. Refer to EmxFactory.EmxImpl
for
supported EMX implementations.descriptor
- An address descriptor that contains the information
needed to create the endpoint.
EEmxNwLnkInvalidTypeException
- Thrown if the link type specified
in the network link descriptor is invalid
EEmxException
- Thrown if any other exception was encountered
while creating the new network link endpoint.
This method create a new EMX network link endpoint. Information needed to create the endpoint is specified via an address descriptor object.
public final IEmxNwLnkEndpoint createNwLnkEndpoint(boolean client, EmxFactory.EmxImpl impl, String descriptorStr, HashMap<String,Object> props) throws EEmxNwLnkDescriptorFormatException, EEmxNwLnkInvalidTypeException, EEmxException
client
- A value of true in this parameter will create a client
endpoint and a value of false will create a server endpoint.impl
- The EMX implementation to use. Refer to EmxFactory.EmxImpl
for
supported EMX implementations.descriptorStr
- A structured string that contains information needed
to create the endpoint. The string must be of the form defined by an
address descriptor object (see UtlAddressDescriptor
) i.e of
the form [type]://[address]&prop=name&prop=name&...&prop=name
where the type specifies the type of link to be create (e.g. tcp,
ssl, http etc) and the remaining portion of the string specifies the
address and configuration parameters to be used by the instantiated link
endpoint (e.g. endpoint host name, port, socket buffer size etc). The
permitted properties that can be specified in this portion is link type
specific.props
- A table containing properties for use by the created link
endpoint. Properties specifies in this table are superceded by properties
parsed from the descriptor string.
EEmxNwLnkDescriptorFormatException
- Thrown if the descriptor is
not of the form [link type]://[address]&prop=name&prop=name&....
EEmxNwLnkInvalidTypeException
- Thrown if the link type specified
in the network link descriptor is invalid
EEmxException
- Thrown if any other exception was encountered
while creating the new network link endpoint.
This method is a convenience method to create a new EMX network link
endpoint. Information needed to create the endpoint is specified via a
structured string (see descriptorStr) and a properties table.
The method parses the descriptor string and properties table into
an UtlAddressDescriptor
and invokes the network link creation
method that uses an address descriptor to accept link creation info.
public final IEmxNwLnkClientEndpoint createNwLnkClientEndpoint(EmxFactory.EmxImpl impl, String descriptorStr, HashMap<String,Object> props) throws EEmxNwLnkDescriptorFormatException, EEmxNwLnkInvalidTypeException, EEmxException
This method is a convenience method to create a network link client
endpoint. The method calls the appropriate createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
method to create the client endpoint.
EEmxNwLnkDescriptorFormatException
EEmxNwLnkInvalidTypeException
EEmxException
createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
public final IEmxNwLnkClientEndpoint createNwLnkClientEndpoint(EmxFactory.EmxImpl impl, com.neeve.util.UtlAddressDescriptor descriptor) throws EEmxNwLnkDescriptorFormatException, EEmxNwLnkInvalidTypeException, EEmxException
This method is a convenience method to create a network link client
endpoint. The method calls the appropriate createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
method to create the client endpoint.
EEmxNwLnkDescriptorFormatException
EEmxNwLnkInvalidTypeException
EEmxException
createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
public final IEmxNwLnkServerEndpoint createNwLnkServerEndpoint(EmxFactory.EmxImpl impl, String descriptorStr, HashMap<String,Object> props) throws EEmxNwLnkDescriptorFormatException, EEmxNwLnkInvalidTypeException, EEmxException
This method is a convenience method to create a network link server
endpoint. The method calls into the createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
to
create the server endpoint. Refer to createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
for
parameter documentation.
EEmxNwLnkDescriptorFormatException
EEmxNwLnkInvalidTypeException
EEmxException
createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
public final IEmxNwLnkServerEndpoint createNwLnkServerEndpoint(EmxFactory.EmxImpl impl, com.neeve.util.UtlAddressDescriptor descriptor) throws EEmxNwLnkDescriptorFormatException, EEmxNwLnkInvalidTypeException, EEmxException
This method is a convenience method to create a network link server
endpoint. The method calls the appropriate createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
method to create the server endpoint.
EEmxNwLnkDescriptorFormatException
EEmxNwLnkInvalidTypeException
EEmxException
createNwLnkEndpoint(boolean, com.neeve.emx.EmxFactory.EmxImpl, com.neeve.util.UtlAddressDescriptor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |