com.vii.brillien.kernel.axiom.atomic
Interface PresenceManager<P extends Presence,C extends Communication>

All Superinterfaces:
Aspirer<C,Object>, Callable<Object>, Presence<C,Object>, Progressor, Sensor<C>, Unit<P,C,Object>

public interface PresenceManager<P extends Presence,C extends Communication>
extends Unit<P,C,Object>

Instantiation manager interface, factory-like interface according the environment of the component like: used libraries, component version, transaction management, instance management type, etc. A Presence type (class) is managed by this object to create/build/stop/destruct instances.


Field Summary
 
Fields inherited from interface com.vii.brillien.kernel.axiom.atomic.Presence
CONSONANT, RESIDENT, SPARKLE
 
Method Summary
 void addPresenceService(String service, Map<String,Class> parameters)
          Dynamically registers new service provided by a given presence
 ClassLoader getClassLoader()
          Getter method for the classloader assigned to this PresenceManager
 String getFlowIDPrefix()
          Getter method to request the prefix for generating FlowIDs
 P getInstance(Presence caller)
          Getter method for a new instance of the Presence type specifying the caller
 P getInstance(Presence caller, String name)
          Getter method for a new instance of the Presence type specifying the caller
 P getInstance(String flowID)
          Getter method for a new instance of the Presence type specifying the ID of the flow
 P getInstance(String flowID, String name)
          Getter method for a new instance of the Presence type specifying the ID of the flow
 Level getLogLevel()
          Getter method for log level of the specific Presence type
 int getLogType()
          Getter method for log type of the specific Presence type
 int getManagementType()
          Getter method to get the instance creation method to follow regarding this Presence type.
<T> Mediator<C,T>
getMediator()
          Retrieves a mediator representing the transport layer
 long getMessageExpiration()
          Gets the timout for message processing.
 Map<String,Object> getParameters()
          Getter method for getting input parameters
 String getPresenceApiVersion()
          Retrieves the version of the given presence
 PresenceBoard getPresenceBoard()
           
 Class<P> getPresenceClass()
          Getter method to request the Class definition of a specific Presence type
 CronPattern getPresenceCronPattern()
          Gets the CronPattern instance made from datePattern string
 String getPresenceDatePattern()
          Retrieces the date pattern of the the given Presence type for callable activity scheduling
 long getPresenceTimeMeasure()
          Retrieves the timeUnit value of the given Presence type.
 Collection<Method> getServiceMethods()
          Retrieves the service methods of the presence type managed by this manager
 Map<String,Map<String,String>> getServiceParameters()
          Retrieves the parameters of the service methods of the presence type managed by this manager
 Map<String,Map<String,Class>> getServiceTypedParameters()
          Retrieves the parameters with their Java types of the service methods of the presence type managed by this manager
 void initPresenceManager(String presenceName, Class<P> PresenceClass, String apiVersion)
          Initializes the PresenceManager with the given class instance, reads the annotations of the presence type
 boolean isApiKeyProtected()
          Tells whether the services of this class is protected by the API_KEY if present
 boolean isPresencePeriodical()
          Gets the periodicity flag of the given Presence type
 boolean isSSOProtected()
          Tells whether the services of this class is protected by the SSO if present
 boolean isStrait()
          Tells whether the presences managed by this presencemanager reject all messages without an associated handler to it
 void markMessageToSend(C shared, C message)
          Presences let the PresenceManager to know about the messages sent through this method
 void retrieveReference(P presence)
          The Presence instance managed by this PresenceManager will be retrieved
 void retrieveReferences(Iterable<P> presences)
          All given Presence instances managed by this PresenceManager will be retrieved
 void setClassLoader(ClassLoader classLoader)
          Sets classloader to be assigned to this PresenceManager
 void setLogLevel(String logLevel)
          Setter method for log level of the specific Presence type
 void setLogType(int logType)
          Setter method for log type of the specific Presence type
 void setMessageExpiration(long messageExpiration)
          Sets the timout for message processing.
 void setParameters(Map<String,Object> parameters)
          Setter method for adding input Parameters for every given Presence creation
 void setPresenceBoard(PresenceBoard board)
           
 void setPresenceCronPattern(CronPattern cronPattern)
          Sets the CronPattern instance made from datePattern string
 void setPresenceDatePattern(String datePattern)
          Sets the date pattern of the the given Presence type for callable activity scheduling
 void setPresencePeriodical(boolean presencePeriodical)
          Sets the periodicity flag of the given Presence type
 void setPresenceTimeMeasure(long timeMeasure)
          Sets the timeUnit value of the the given Presence type, read from the nnnotation of the type.
 void setSSOPresenceName(String ssoPresenceName)
          Sets custom SSO presence
 void setStrait(boolean strait)
          Sets if the presences managed by this presencemanager reject all messages without an associated handler to it
 
Methods inherited from interface com.vii.brillien.kernel.axiom.atomic.Unit
activateUnitAll, activateUnitCallable, activateUnitMessaging, addPresence, addPresences, addSubUnit, addSubUnits, classify, clearPresences, clearSubUnits, communicationUnitReceived, complement, getCharacteristicFunction, getPresences, getSubUnits, hasUnitActivity, intersect, isSubSet, isUnitInExitState, isUnitInValidStates, isUnitWaitingForResponse, order, passivateUnitAll, passivateUnitCallable, passivateUnitMessaging, printUnitErrorStates, removePresence, removePresences, removeSubUnit, removeSubUnits, retrieveUnit, scrutinise, setCharacteristicFunction, subset, symmetricDifference, union
 
Methods inherited from interface com.vii.brillien.kernel.axiom.atomic.Presence
activateAll, addSuperUnits, clearSuperUnits, getApiKeyPresenceName, getApiVersion, getFlow, getFlowID, getLoggedUser, getLoggedUser, getPresence, getPresenceManager, getSharing, getSSOPresenceName, getSuperUnits, loginUser, passivateAll, printErrorStates, removeSuperUnits, retrieve, setApiVersion, setFlow, setPresenceManager
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Presence
aspirationTimeIsUp, getAspirationPattern, getAspirationTimeMeasure, getFullName, getInterface, getMessageProcessorParameterNames, getMessageProcessorParameterTypes, getName, hasMessageProcessorReturnValue, isAspirationPeriodical, reset, setAspirationPattern, setAspirationPeriodical, setAspirationTimeMeasure, setName
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Aspirer
activateCallable, getResult, hasActivity, isWaitingForInputData, isWaitingForResponse, passivateCallable, plan, sendAGet, sendDelegatedSet, sendError, sendError, sendError, sendGet, sendGet, sendResponse, sendSet, sendUnitAGet, sendUnitDelegatedSet, sendUnitGet, sendUnitGet, sendUnitSet
 
Methods inherited from interface java.util.concurrent.Callable
call
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Sensor
activateMessaging, communicationReceived, errorReceived, passivateMessaging, presenseChangedState
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Progressor
addState, changeState, getActualStates, getPotentialStates, getStateDivision, hasStateMachine, initStateMashine, isInExitState, isInState, isInValidStates, panic, registerStateChangeNotification, removeState, setStateDivision, unregisterStateChangeNotification
 

Method Detail

initPresenceManager

void initPresenceManager(String presenceName,
                         Class<P> PresenceClass,
                         String apiVersion)
                         throws BrillienException
Initializes the PresenceManager with the given class instance, reads the annotations of the presence type

Parameters:
PresenceClass - presence class instance
Throws:
BrillienException

getPresenceClass

Class<P> getPresenceClass()
Getter method to request the Class definition of a specific Presence type


getPresenceApiVersion

String getPresenceApiVersion()
Retrieves the version of the given presence


getServiceMethods

Collection<Method> getServiceMethods()
Retrieves the service methods of the presence type managed by this manager

Returns:

getServiceTypedParameters

Map<String,Map<String,Class>> getServiceTypedParameters()
Retrieves the parameters with their Java types of the service methods of the presence type managed by this manager


addPresenceService

void addPresenceService(String service,
                        Map<String,Class> parameters)
Dynamically registers new service provided by a given presence


getServiceParameters

Map<String,Map<String,String>> getServiceParameters()
Retrieves the parameters of the service methods of the presence type managed by this manager


getFlowIDPrefix

String getFlowIDPrefix()
Getter method to request the prefix for generating FlowIDs


getInstance

P getInstance(Presence caller)
                               throws BrillienException
Getter method for a new instance of the Presence type specifying the caller

Throws:
BrillienException

getInstance

P getInstance(String flowID)
                               throws BrillienException
Getter method for a new instance of the Presence type specifying the ID of the flow

Throws:
BrillienException

getInstance

P getInstance(Presence caller,
              String name)
                               throws BrillienException
Getter method for a new instance of the Presence type specifying the caller

Throws:
BrillienException

getInstance

P getInstance(String flowID,
              String name)
                               throws BrillienException
Getter method for a new instance of the Presence type specifying the ID of the flow

Throws:
BrillienException

retrieveReference

void retrieveReference(P presence)
                       throws BrillienException
The Presence instance managed by this PresenceManager will be retrieved

Parameters:
presence - presence to be retrieved
Throws:
BrillienException

retrieveReferences

void retrieveReferences(Iterable<P> presences)
                        throws BrillienException
All given Presence instances managed by this PresenceManager will be retrieved

Parameters:
presences - presences to be retrieved
Throws:
BrillienException

getClassLoader

ClassLoader getClassLoader()
Getter method for the classloader assigned to this PresenceManager


setClassLoader

void setClassLoader(ClassLoader classLoader)
Sets classloader to be assigned to this PresenceManager


getManagementType

int getManagementType()
Getter method to get the instance creation method to follow regarding this Presence type. One of the following will be returned: RESIDENT, Sparkle, CONSONANT

Returns:
instance creation type ID

isSSOProtected

boolean isSSOProtected()
Tells whether the services of this class is protected by the SSO if present


isApiKeyProtected

boolean isApiKeyProtected()
Tells whether the services of this class is protected by the API_KEY if present


getPresenceTimeMeasure

long getPresenceTimeMeasure()
Retrieves the timeUnit value of the given Presence type. Measured in milliseconds.


setPresenceTimeMeasure

void setPresenceTimeMeasure(long timeMeasure)
Sets the timeUnit value of the the given Presence type, read from the nnnotation of the type. Measured in milliseconds.


getPresenceDatePattern

String getPresenceDatePattern()
Retrieces the date pattern of the the given Presence type for callable activity scheduling


setPresenceDatePattern

void setPresenceDatePattern(String datePattern)
Sets the date pattern of the the given Presence type for callable activity scheduling


getPresenceCronPattern

CronPattern getPresenceCronPattern()
Gets the CronPattern instance made from datePattern string


setPresenceCronPattern

void setPresenceCronPattern(CronPattern cronPattern)
Sets the CronPattern instance made from datePattern string


isPresencePeriodical

boolean isPresencePeriodical()
Gets the periodicity flag of the given Presence type


setPresencePeriodical

void setPresencePeriodical(boolean presencePeriodical)
Sets the periodicity flag of the given Presence type


getMessageExpiration

long getMessageExpiration()
Gets the timout for message processing. Every incoming message which has been sent before (currentTimeMillis-expiration) is considered as expired amd will be ignored.


setMessageExpiration

void setMessageExpiration(long messageExpiration)
Sets the timout for message processing. Every incoming message which has been sent before (currentTimeMillis-expiration) is considered as expired amd will be ignored.


isStrait

boolean isStrait()
Tells whether the presences managed by this presencemanager reject all messages without an associated handler to it


setStrait

void setStrait(boolean strait)
Sets if the presences managed by this presencemanager reject all messages without an associated handler to it


getLogType

int getLogType()
Getter method for log type of the specific Presence type


setLogType

void setLogType(int logType)
Setter method for log type of the specific Presence type

Parameters:
logType - log type

getLogLevel

Level getLogLevel()
Getter method for log level of the specific Presence type


setLogLevel

void setLogLevel(String logLevel)
Setter method for log level of the specific Presence type

Parameters:
logLevel - log level

getParameters

Map<String,Object> getParameters()
Getter method for getting input parameters

Returns:
parametersMap parameters' hashmap read from the presence config file

setParameters

void setParameters(Map<String,Object> parameters)
Setter method for adding input Parameters for every given Presence creation

Parameters:
parameters - parameters' hashmap read from the presence config file

setSSOPresenceName

void setSSOPresenceName(String ssoPresenceName)
Sets custom SSO presence


markMessageToSend

void markMessageToSend(C shared,
                       C message)
Presences let the PresenceManager to know about the messages sent through this method


setPresenceBoard

void setPresenceBoard(PresenceBoard board)

getPresenceBoard

PresenceBoard getPresenceBoard()

getMediator

<T> Mediator<C,T> getMediator()
Retrieves a mediator representing the transport layer



Copyright © 2012. All Rights Reserved.