com.neeve.link
Class LnkFactory

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.link.LnkObject
          extended by com.neeve.link.LnkFactory

public final class LnkFactory
extends LnkObject

Factory class used to create links.

This class is a singleton class used to create links. This class identifies the various link types installed in a deployment by the simple configuration entities in the '/links' entity container in rhe default configuration repository. Each entity in the container represents an installed link type with the name of the entity being the link type name and the contents containing the name of the client endpoint and server endpoint classes for links of that type.

Upon startup, this file parses all the entities in the '/links' container and binds to the various endpoint classes. When a user requests for an instance of a client or server endpoint , it supplies a link descriptor of the form [type]://[address]&prop=name&prop=name&...&prop=name where the type determines the link type (e.g. tcp, ssl, http, cl, rou etc) and the remaining specifies the address and configuration parameters to be used by the instantiated link endpoint (e.g. endpoint host name, port, socket buffer size etc).


Method Summary
 ILnkClientEndpoint createClientEndpoint(String descriptorStr, HashMap<String,Object> props)
          Create a link client endpoint.
 ILnkClientEndpoint createClientEndpoint(com.neeve.util.UtlAddressDescriptor descriptor)
          Create a link client endpoint.
 ILnkServerEndpoint createServerEndpoint(String descriptorStr, HashMap<String,Object> props)
          Create a link server endpoint.
 ILnkServerEndpoint createServerEndpoint(com.neeve.util.UtlAddressDescriptor descriptor)
          Create a link server endpoint.
static LnkFactory getInstance()
          Return the singleton link 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

getInstance

public static LnkFactory getInstance()
Return the singleton link factory instance

Returns:
Returns the link factory
Threading:
This method is safe for concurrent access by multiple threads

createClientEndpoint

public final ILnkClientEndpoint createClientEndpoint(com.neeve.util.UtlAddressDescriptor descriptor)
                                              throws ELnkInvalidLinkTypeException,
                                                     ELnkEndpointClassLoadException,
                                                     ELnkEndpointClassInstantiateException,
                                                     ELnkException
Create a link client endpoint.

Parameters:
descriptor - An address descriptor that contains the information needed to create the endpoint.
Returns:
Returns the created link client endpoint
Throws:
ELnkInvalidLinkTypeException - Thrown if the link type specified in the link descriptor is invalid
ELnkEndpointClassLoadException - Thrown if a failure was encountered while loading the link client endpoint class as specified in link type configuration file.
ELnkEndpointClassInstantiateException - Thrown if a failure was encountered while instantiating the link client endpoint class as specified in link type configuration file.
ELnkException - Thrown if any other exception was encountered while creating the new link client endpoint.
Threading:
This method is safe for concurrent access by multiple threads

This method creates a new link client endpoint. All information required to create the endpoint including the link type and configuration parameters is specified via an address descriptor object.


createClientEndpoint

public final ILnkClientEndpoint createClientEndpoint(String descriptorStr,
                                                     HashMap<String,Object> props)
                                              throws ELnkDescriptorFormatException,
                                                     ELnkInvalidLinkTypeException,
                                                     ELnkEndpointClassLoadException,
                                                     ELnkEndpointClassInstantiateException,
                                                     ELnkException
Create a link client endpoint.

Parameters:
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, cl, rou 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 properties that can be specified in this portion of the descriptor is link type specific.
props - A set of properties used in the creation of the endpoint. Properties in this table are overridden by properties specified in the descriptor string. The valid set of properties are defined by the link type.
Returns:
Returns the created link client endpoint
Throws:
ELnkDescriptorFormatException - Thrown if the descriptor is not of the form specified by UtlAddressDescriptor.
ELnkInvalidLinkTypeException - Thrown if the link type specified in the link descriptor is invalid
ELnkEndpointClassLoadException - Thrown if a failure was encountered while loading the link client endpoint class as specified in link type configuration file.
ELnkEndpointClassInstantiateException - Thrown if a failure was encountered while instantiating the link client endpoint class as specified in link type configuration file.
ELnkException - Thrown if any other exception was encountered while creating the new link client endpoint.
Threading:
This method is safe for concurrent access by multiple threads

This method creates a new link client endpoint. All information required to create the endpoint including the link type and configuration parameters is specified via a link descriptor string and a set of properties. See UtlAddressDescriptor and descriptorStr for more information on the format of the descriptor string.


createServerEndpoint

public final ILnkServerEndpoint createServerEndpoint(com.neeve.util.UtlAddressDescriptor descriptor)
                                              throws ELnkInvalidLinkTypeException,
                                                     ELnkEndpointClassLoadException,
                                                     ELnkEndpointClassInstantiateException,
                                                     ELnkException
Create a link server endpoint.

Parameters:
descriptor - An address descriptor that contains the information needed to create the endpoint.
Returns:
Returns the created link server endpoint
Throws:
ELnkInvalidLinkTypeException - Thrown if the link type specified in the link descriptor is invalid
ELnkEndpointClassLoadException - Thrown if a failure was encountered while loading the link client endpoint class as specified in link type configuration file.
ELnkEndpointClassInstantiateException - Thrown if a failure was encountered while instantiating the link client endpoint class as specified in link type configuration file.
ELnkException - Thrown if any other exception was encountered while creating the new link client endpoint.
Threading:
This method is safe for concurrent access by multiple threads

This method creates a new link server endpoint. All information required to create the endpoint including the link type and configuration parameters is specified via an address descriptor object.


createServerEndpoint

public final ILnkServerEndpoint createServerEndpoint(String descriptorStr,
                                                     HashMap<String,Object> props)
                                              throws ELnkDescriptorFormatException,
                                                     ELnkInvalidLinkTypeException,
                                                     ELnkEndpointClassLoadException,
                                                     ELnkEndpointClassInstantiateException,
                                                     ELnkException
Create a link server endpoint.

Parameters:
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, cl, rou 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 properties that can be specified in this portion of the descriptor is link type specific.
props - A set of properties used in the creation of the endpoint. Properties in this table are overridden by properties specified in the descriptor string. The valid set of properties are defined by the link type.
Returns:
Returns the created link server endpoint
Throws:
ELnkDescriptorFormatException - Thrown if the descriptor is not of the form specified by UtlAddressDescriptor.
ELnkInvalidLinkTypeException - Thrown if the link type specified in the link descriptor is invalid
ELnkEndpointClassLoadException - Thrown if a failure was encountered while loading the link client endpoint class as specified in link type configuration file.
ELnkEndpointClassInstantiateException - Thrown if a failure was encountered while instantiating the link client endpoint class as specified in link type configuration file.
ELnkException - Thrown if any other exception was encountered while creating the new link client endpoint.
Threading:
This method is safe for concurrent access by multiple threads

This method creates a new link server endpoint. All information required to create the endpoint including the link type and configuration parameters is specified via a link descriptor string and a set of properties. See UtlAddressDescriptor and descriptorStr for more information on the format of the descriptor string.



Copyright © 2015 Neeve Research, LLC. All Rights Reserved.