org.mule.registry.impl
Class AbstractRegistryComponent

java.lang.Object
  extended byorg.mule.registry.impl.AbstractEntry
      extended byorg.mule.registry.impl.AbstractRegistryComponent
All Implemented Interfaces:
Entry, RegistryComponent, Serializable

public abstract class AbstractRegistryComponent
extends AbstractEntry
implements RegistryComponent

todo document

Version:
$Revision: 7976 $
Author:
Ross Mason
See Also:
Serialized Form

Field Summary
protected  List classPathElements
           
protected  Object component
           
protected  String componentClassName
           
protected  RegistryDescriptor descriptor
           
protected  boolean isClassLoaderParentFirst
           
protected  boolean isTransient
           
protected  List libraries
           
protected  String name
           
protected  javax.management.ObjectName objectName
           
protected  ComponentType type
           
protected  List units
           
protected  String workspaceRoot
           
 
Fields inherited from class org.mule.registry.impl.AbstractEntry
currentState, installRoot, registry, stateAtShutdown
 
Fields inherited from interface org.mule.registry.Entry
INITIALIZED, RUNNING, SHUTDOWN, STOPPED, UNKNOWN
 
Constructor Summary
protected AbstractRegistryComponent(String name, ComponentType type, Registry registry)
           
 
Method Summary
 void addUnit(Unit unit)
           
protected  void checkDescriptor()
           
protected  void createComponent()
           
protected abstract  void doInstall()
           
protected abstract  void doRestoreState()
           
protected abstract  void doShutDown()
           
protected abstract  void doStart()
           
protected abstract  void doStop()
           
 List getClassPathElements()
           
 Object getComponent()
          Return the component implementation.
 RegistryDescriptor getDescriptor()
          Return the descriptor for this component.
 Library[] getLibraries()
          Retrieves the libraries that this component uses.
 javax.management.ObjectName getObjectName()
          Return the ObjectName under which the lifecycle mbean is registered.
 ComponentType getType()
           
 Unit[] getUnits()
          Units deployed to this component
 String getWorkspaceRoot()
          Return the private component workspace
 void install()
          Install this component.
 boolean isClassLoaderParentFirst()
           
 boolean isTransient()
           
protected  void readObject(ObjectInputStream in)
           
 void removeUnit(Unit unit)
           
 void restoreState()
           
 void saveAndShutdown()
           
 void setClassPathElements(List classPathElements)
           
 void setComponent(Object component)
           
 void setDescriptor(RegistryDescriptor descriptor)
           
 void setTransient(boolean isTransient)
           
 void setWorkspaceRoot(String workspaceRoot)
           
 void shutDown()
          Shut down the item.
 void start()
          Start the item.
 void stop()
          Stop the item.
 void uninstall()
          Uninstall this component.
 
Methods inherited from class org.mule.registry.impl.AbstractEntry
getCurrentState, getInstallRoot, getName, getRegistry, getStateAtShutdown, setCurrentState, setInstallRoot, setName, setRegistry, setStateAtShutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.registry.RegistryComponent
getRegistry, initComponent
 
Methods inherited from interface org.mule.registry.Entry
getCurrentState, getInstallRoot, getName, getStateAtShutdown, setCurrentState, setInstallRoot, setName, setStateAtShutdown
 

Field Detail

type

protected ComponentType type

name

protected String name

objectName

protected transient javax.management.ObjectName objectName

units

protected List units

libraries

protected List libraries

workspaceRoot

protected String workspaceRoot

classPathElements

protected List classPathElements

componentClassName

protected String componentClassName

isClassLoaderParentFirst

protected boolean isClassLoaderParentFirst

isTransient

protected boolean isTransient

component

protected Object component

descriptor

protected RegistryDescriptor descriptor
Constructor Detail

AbstractRegistryComponent

protected AbstractRegistryComponent(String name,
                                    ComponentType type,
                                    Registry registry)
Method Detail

getType

public ComponentType getType()
Specified by:
getType in interface RegistryComponent

readObject

protected void readObject(ObjectInputStream in)
                   throws IOException,
                          ClassNotFoundException
Overrides:
readObject in class AbstractEntry
Throws:
IOException
ClassNotFoundException

getLibraries

public Library[] getLibraries()
Description copied from interface: RegistryComponent
Retrieves the libraries that this component uses.

Specified by:
getLibraries in interface RegistryComponent
Returns:

getUnits

public Unit[] getUnits()
Description copied from interface: RegistryComponent
Units deployed to this component

Specified by:
getUnits in interface RegistryComponent
Returns:

addUnit

public void addUnit(Unit unit)
Specified by:
addUnit in interface RegistryComponent

removeUnit

public void removeUnit(Unit unit)
Specified by:
removeUnit in interface RegistryComponent

getObjectName

public javax.management.ObjectName getObjectName()
Description copied from interface: RegistryComponent
Return the ObjectName under which the lifecycle mbean is registered.

Specified by:
getObjectName in interface RegistryComponent
Returns:

checkDescriptor

protected void checkDescriptor()
                        throws RegistryException
Overrides:
checkDescriptor in class AbstractEntry
Throws:
RegistryException

createComponent

protected void createComponent()
                        throws RegistryException
Throws:
RegistryException

install

public void install()
             throws RegistryException
Description copied from interface: RegistryComponent
Install this component.

Specified by:
install in interface RegistryComponent
Throws:
RegistryException

doInstall

protected abstract void doInstall()
                           throws Exception
Throws:
Exception

restoreState

public final void restoreState()
                        throws RegistryException
Specified by:
restoreState in interface RegistryComponent
Throws:
RegistryException

doRestoreState

protected abstract void doRestoreState()
                                throws Exception
Throws:
Exception

saveAndShutdown

public void saveAndShutdown()
                     throws RegistryException
Specified by:
saveAndShutdown in interface RegistryComponent
Throws:
RegistryException

start

public final void start()
                 throws RegistryException
Description copied from interface: RegistryComponent
Start the item.

Specified by:
start in interface RegistryComponent
Throws:
RegistryException - if the item fails to start.

doStart

protected abstract void doStart()
                         throws Exception
Throws:
Exception

stop

public final void stop()
                throws RegistryException
Description copied from interface: RegistryComponent
Stop the item. This suspends current messaging activities.

Specified by:
stop in interface RegistryComponent
Throws:
RegistryException - if the item fails to stop.

doStop

protected abstract void doStop()
                        throws Exception
Throws:
Exception

shutDown

public final void shutDown()
                    throws RegistryException
Description copied from interface: RegistryComponent
Shut down the item. The releases resources, preparatory to uninstallation.

Specified by:
shutDown in interface RegistryComponent
Throws:
RegistryException - if the item fails to shut down.

doShutDown

protected abstract void doShutDown()
                            throws Exception
Throws:
Exception

uninstall

public void uninstall()
               throws RegistryException
Description copied from interface: RegistryComponent
Uninstall this component.

Specified by:
uninstall in interface RegistryComponent
Throws:
RegistryException

getWorkspaceRoot

public String getWorkspaceRoot()
Description copied from interface: RegistryComponent
Return the private component workspace

Specified by:
getWorkspaceRoot in interface RegistryComponent
Returns:

setWorkspaceRoot

public void setWorkspaceRoot(String workspaceRoot)
Specified by:
setWorkspaceRoot in interface RegistryComponent

getClassPathElements

public List getClassPathElements()
Specified by:
getClassPathElements in interface RegistryComponent

setClassPathElements

public void setClassPathElements(List classPathElements)
Specified by:
setClassPathElements in interface RegistryComponent

isClassLoaderParentFirst

public boolean isClassLoaderParentFirst()
Specified by:
isClassLoaderParentFirst in interface RegistryComponent

setComponent

public void setComponent(Object component)
Specified by:
setComponent in interface RegistryComponent

isTransient

public boolean isTransient()
Specified by:
isTransient in interface RegistryComponent

setTransient

public void setTransient(boolean isTransient)
Specified by:
setTransient in interface RegistryComponent

getComponent

public Object getComponent()
Return the component implementation.

Specified by:
getComponent in interface RegistryComponent
Returns:

getDescriptor

public RegistryDescriptor getDescriptor()
                                 throws RegistryException
Return the descriptor for this component.

Specified by:
getDescriptor in interface RegistryComponent
Returns:
Throws:
RegistryException

setDescriptor

public void setDescriptor(RegistryDescriptor descriptor)
                   throws RegistryException
Specified by:
setDescriptor in interface RegistryComponent
Throws:
RegistryException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.