org.jboss.system.server.profileservice.persistence.component
Class AbstractComponentMapper

java.lang.Object
  extended by org.jboss.system.server.profileservice.persistence.component.AbstractComponentMapper
All Implemented Interfaces:
ComponentMapper
Direct Known Subclasses:
KernelDeploymentComponentMapper

public abstract class AbstractComponentMapper
extends Object
implements ComponentMapper

The abstract component mapper.

Version:
$Revision$
Author:
Emanuel Muckenhuber

Constructor Summary
AbstractComponentMapper(PersistenceFactory persistenceFactory)
           
 
Method Summary
 PersistedComponent addComponent(Object attachment, org.jboss.managed.api.ManagedComponent component)
          Add a component.
protected  PersistedComponent createComponent(Object attachment, org.jboss.managed.api.ManagedComponent component)
          Create the persisted information for a given ManagedComponent.
protected  PersistedComponent createPersistedComponent(Object attachment, org.jboss.managed.api.ManagedComponent component, ModificationInfo modification)
          Create a persisted component for a given ManagedComponent.
protected abstract  org.jboss.managed.api.ManagedObject getComponent(Object attachment, PersistedComponent component, boolean create)
          Get a ManagedObject for a given component, based on the information in the attachment descriptor.
 org.jboss.managed.api.factory.ManagedObjectFactory getMOF()
           
 ManagedObjectPersistencePlugin getPersistencePlugin()
           
 PersistedComponent removeComponent(Object attachment, org.jboss.managed.api.ManagedComponent component)
          Remove a component.
protected abstract  void removeComponent(Object attachment, PersistedComponent component)
          Remove a component from the attachment.
 void restoreComponent(Object attachment, PersistedComponent component)
          Restore a component based on the persisted information.
protected abstract  void setComponentName(PersistedComponent component, org.jboss.managed.api.ManagedObject mo)
          Set the current name for this component.
 PersistedComponent updateComponent(Object attachment, org.jboss.managed.api.ManagedComponent component)
          Update a component.
protected  void updateComponent(Object attachment, PersistedComponent component, boolean added)
          Update a attachment descripto based on the persisted component information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.server.profileservice.persistence.component.ComponentMapper
getType
 

Constructor Detail

AbstractComponentMapper

public AbstractComponentMapper(PersistenceFactory persistenceFactory)
Method Detail

getPersistencePlugin

public ManagedObjectPersistencePlugin getPersistencePlugin()

getMOF

public org.jboss.managed.api.factory.ManagedObjectFactory getMOF()

restoreComponent

public void restoreComponent(Object attachment,
                             PersistedComponent component)
Description copied from interface: ComponentMapper
Restore a component based on the persisted information.

Specified by:
restoreComponent in interface ComponentMapper
Parameters:
attachment - the attachment
component - the persisted component

addComponent

public PersistedComponent addComponent(Object attachment,
                                       org.jboss.managed.api.ManagedComponent component)
Description copied from interface: ComponentMapper
Add a component.

Specified by:
addComponent in interface ComponentMapper
Parameters:
attachment - the parent attachment
component - the managed component
Returns:
the persisted managed component

updateComponent

public PersistedComponent updateComponent(Object attachment,
                                          org.jboss.managed.api.ManagedComponent component)
Description copied from interface: ComponentMapper
Update a component.

Specified by:
updateComponent in interface ComponentMapper
Parameters:
attachment - the parent attachment
component - the managed component
Returns:
the persisted managed component

removeComponent

public PersistedComponent removeComponent(Object attachment,
                                          org.jboss.managed.api.ManagedComponent component)
Description copied from interface: ComponentMapper
Remove a component.

Specified by:
removeComponent in interface ComponentMapper
Parameters:
attachment - the parent attachment
component - the managed component
Returns:
the persisted managed component

removeComponent

protected abstract void removeComponent(Object attachment,
                                        PersistedComponent component)
Remove a component from the attachment.

Parameters:
attachment - the attachment
component - the component to remove

getComponent

protected abstract org.jboss.managed.api.ManagedObject getComponent(Object attachment,
                                                                    PersistedComponent component,
                                                                    boolean create)
Get a ManagedObject for a given component, based on the information in the attachment descriptor.

Parameters:
attachment - the attachment
component - the component
create - whether to create a non existing component or not
Returns:
the managed object for the component

createComponent

protected PersistedComponent createComponent(Object attachment,
                                             org.jboss.managed.api.ManagedComponent component)
Create the persisted information for a given ManagedComponent.

Parameters:
attachment - the attachment
component - the managed component
Returns:
the persisted component

setComponentName

protected abstract void setComponentName(PersistedComponent component,
                                         org.jboss.managed.api.ManagedObject mo)
Set the current name for this component.

Parameters:
component - the persisted component
mo - the managed object

updateComponent

protected void updateComponent(Object attachment,
                               PersistedComponent component,
                               boolean added)
Update a attachment descripto based on the persisted component information.

Parameters:
attachment - the attachment
component - the persisted component
added - whether this component was added or not

createPersistedComponent

protected PersistedComponent createPersistedComponent(Object attachment,
                                                      org.jboss.managed.api.ManagedComponent component,
                                                      ModificationInfo modification)
Create a persisted component for a given ManagedComponent.

Parameters:
attachment - the attachment
component - the managed component
modification - the modification info
Returns:
the persisted component


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.