planet.generic.commonapi.factory
Class EndPointFactoryImpl

java.lang.Object
  extended byplanet.generic.commonapi.factory.EndPointFactoryImpl
All Implemented Interfaces:
EndPointFactory

public class EndPointFactoryImpl
extends java.lang.Object
implements EndPointFactory

This class uses the Factory Method pattern design to build new EndPoints. For this, it requires a concrete property at factory properties file:

Secondly, the implementation class must have a constructor with the following arguments: And that's all!!

Author:
Jordi Pujol

Constructor Summary
EndPointFactoryImpl(java.lang.Class endPointClass)
          Constructor for the factory using the specified implementation class of EndPoint.
EndPointFactoryImpl(java.lang.String factoryProperties)
          Constructor for the factory using the specified factory properties file.
 
Method Summary
 EndPoint buildEndPoint(Application app, Node node)
          Builds a new instance of EndPoint, relating specified Application and Node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndPointFactoryImpl

public EndPointFactoryImpl(java.lang.String factoryProperties)
                    throws InitializationException
Constructor for the factory using the specified factory properties file.

Parameters:
factoryProperties - Properties file with all items for factories.
Throws:
InitializationException - if an error has occurred.

EndPointFactoryImpl

public EndPointFactoryImpl(java.lang.Class endPointClass)
                    throws InitializationException
Constructor for the factory using the specified implementation class of EndPoint.

Parameters:
endPointClass - Implementation class of EndPoint.
Throws:
InitializationException - if an error has occurred.
Method Detail

buildEndPoint

public EndPoint buildEndPoint(Application app,
                              Node node)
                       throws InitializationException
Builds a new instance of EndPoint, relating specified Application and Node.

Specified by:
buildEndPoint in interface EndPointFactory
Parameters:
app - Application to run over the node.
node - Node over which run the specified application.
Returns:
A new instance of EndPoint that relates the Application and the Node.
Throws:
InitializationException
See Also:
EndPointFactory.buildEndPoint(planet.commonapi.Application, planet.commonapi.Node)