p2pcm
Class Component

java.lang.Object
  extended by dermi.EventServer
      extended by dermi.DermiRemoteObject
          extended by p2pcm.Component
All Implemented Interfaces:
dermi.listener.RemoteEventListener, java.io.Serializable

public class Component
extends dermi.DermiRemoteObject

This class is the base class for a Dermi Component. It is in fact a special kind of Dermi Remote Object which provides the component's standard methods

Version:
1.2
Author:
Carles Pairot
See Also:
Serialized Form

Field Summary
 
Fields inherited from class dermi.DermiRemoteObject
logger
 
Fields inherited from class dermi.EventServer
className, classStore, conn, eref, uid
 
Constructor Summary
Component()
          Default void Dermi Remote Object constructor
Component(java.util.Properties env)
          Default Dermi Remote Object constructor
 
Method Summary
 void activate()
          This method implements the default activation policy for components It thus follows this algorithm: - Obtain first the node's 5 most suitable replicas - If replica number is less than 2, it is impossible to activate new components (node is isolated) - Identify which node is overwhelming this component, and activate new object replica there, unless there is an already active instance within that node.
 ComponentControl getLifeCycleManager()
          Life cycle manager getter method
 void passivate()
          This method implements the default passivation policy for components It now unloads the component from memory.
 void setLifeCycleManager(ComponentControl cc)
          Life cycle manager setter method
 
Methods inherited from class dermi.DermiRemoteObject
addListener, anycallEventArrived, close, copy, eventArrived, getReplicaState, init, loadReplicaState, loadState, removeListener, triggerEvent
 
Methods inherited from class dermi.EventServer
dispatchDirectEvent, dispatchDirectEvent, dispatchEvent, dispatchEvent, dispatchEvent, getBytes, getClassStore, getERef, getUID, start, writeERef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Component

public Component()
Default void Dermi Remote Object constructor


Component

public Component(java.util.Properties env)
          throws dermi.exception.RemoteException
Default Dermi Remote Object constructor

Parameters:
env - Properties Object properties
Throws:
dermi.exception.RemoteException - If something goes wrong ;-)
Method Detail

setLifeCycleManager

public void setLifeCycleManager(ComponentControl cc)
Life cycle manager setter method

Parameters:
cc - ComponentControl A previously initialized life cycle manager

getLifeCycleManager

public ComponentControl getLifeCycleManager()
Life cycle manager getter method

Returns:
ComponentControl The component's life cycle manager

activate

public void activate()
              throws ActivationException
This method implements the default activation policy for components It thus follows this algorithm: - Obtain first the node's 5 most suitable replicas - If replica number is less than 2, it is impossible to activate new components (node is isolated) - Identify which node is overwhelming this component, and activate new object replica there, unless there is an already active instance within that node.

Throws:
ActivationException - If impossible to activate new object replica for any reason (see below)

passivate

public void passivate()
               throws PassivationException
This method implements the default passivation policy for components It now unloads the component from memory. Should take care of possible state persistence, which will be implemented in a near future ;-)

Throws:
PassivationException - If the component cannot be passivated.