org.dbe.eve.factories.servicefactory
Class AbstractServiceFactory

java.lang.Object
  extended by org.dbe.eve.factories.servicefactory.AbstractServiceFactory
Direct Known Subclasses:
GroupedServiceFactory, ServiceFactory

public abstract class AbstractServiceFactory
extends java.lang.Object

this class implements a AbstractServiceFactory, based on the Factory Pattern it is responsible for creating Services plus their Attributes for the SMEFactory it maintains a local AttributePool for instancing Services

Since:
16th of November 2006
Author:
Christoph Adelberger

Field Summary
protected  AttributePool aPool
           
(package private) static org.apache.log4j.Logger logger
           
protected  EvEModel model
           
(package private) static MersenneTwister mt
           
private static int SErviceFactoryType
           
 
Constructor Summary
AbstractServiceFactory()
           
 
Method Summary
abstract  Service createService()
          creates and returns new Service
abstract  DemandedService createServiceOnDemand(SME sme)
          creates and returns new ServiceOnDemand for a given SME
private static AbstractServiceFactory getDefaultFactory()
          creates the Default ServiceFactory
static AbstractServiceFactory getServiceFactory()
          creates a new ServiceFactory if necessary between different types of ServiceFactories can be choosen
static int getServiceFactoryType()
           
 void initialiseDemandedServices(SME sme)
          assigns new demanded Services to a SME
abstract  void initialiseOfferedServices(SME sme)
          assigns new offered Services to a SME and puts them in the localServicePool of the SME
static void setServiceFactoryType(int _serviceFactoryType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger

mt

static MersenneTwister mt

SErviceFactoryType

private static int SErviceFactoryType

model

protected EvEModel model

aPool

protected AttributePool aPool
Constructor Detail

AbstractServiceFactory

public AbstractServiceFactory()
Method Detail

getServiceFactory

public static AbstractServiceFactory getServiceFactory()
creates a new ServiceFactory if necessary between different types of ServiceFactories can be choosen

Parameters:
eVeModel - instance of an EvEModel
Returns:
AbstractServiceFactory

getDefaultFactory

private static AbstractServiceFactory getDefaultFactory()
creates the Default ServiceFactory

Parameters:
eVeModel - instance of an EvEModel
Returns:
AbstractServiceFactory

createService

public abstract Service createService()
creates and returns new Service

Returns:
Service

createServiceOnDemand

public abstract DemandedService createServiceOnDemand(SME sme)
creates and returns new ServiceOnDemand for a given SME

Returns:
Service

initialiseOfferedServices

public abstract void initialiseOfferedServices(SME sme)
assigns new offered Services to a SME and puts them in the localServicePool of the SME

Parameters:
sme - instance of an SME

initialiseDemandedServices

public void initialiseDemandedServices(SME sme)
assigns new demanded Services to a SME

Parameters:
sme - instance of an SME

getServiceFactoryType

public static int getServiceFactoryType()

setServiceFactoryType

public static void setServiceFactoryType(int _serviceFactoryType)
Parameters:
_serviceFactoryType - serviceFactoryType==0 (ServiceFactory... default ServiceFactory serviceFactoryType==1 (GroupedServiceFactory)