org.jboss.system.server.profileservice.persistence
Class AbstractPersistenceFactory

java.lang.Object
  extended by org.jboss.system.server.profileservice.persistence.PersistenceFactory
      extended by org.jboss.system.server.profileservice.persistence.AbstractPersistenceFactory

public class AbstractPersistenceFactory
extends PersistenceFactory

The abstract persistence factory.

Version:
$Revision$
Author:
Emanuel Muckenhuber

Constructor Summary
AbstractPersistenceFactory()
           
AbstractPersistenceFactory(org.jboss.managed.api.factory.ManagedObjectFactory managedObjectFactory)
           
 
Method Summary
 PersistenceRoot addComponent(PersistenceRoot root, org.jboss.managed.api.ManagedObject parent, org.jboss.managed.api.ManagedComponent component)
          Add a ManagedComponent.
 void addComponentMapper(ComponentMapper mapper)
          InstallCallback for adding a component mapper.
protected  PersistenceRoot addPersistedComponent(PersistenceRoot root, PersistedComponent component)
          Add a persisted component to the root.
 void addPersistencePlugin(ManagedObjectPersistencePlugin plugin)
          InstallCallback for adding a persistence plugin.
protected  ComponentMapper getComponentMapper(org.jboss.managed.api.ManagedObject parent)
          Get the component mapper for a given ManagedObject.
protected  ComponentMapper getComponentMapper(PersistenceRoot root)
          Get the component mapper for a persistence root.
protected  ComponentMapper getComponentMapper(String type)
          Get the component mapper for a given type.
 ManagedObjectPersistencePlugin getPersistencePlugin()
          Get the persistence plugin.
protected static Map<String,PersistedComponent> mapComponents(PersistenceRoot root)
          Map the components based on their names.
 PersistenceRoot removeComponent(PersistenceRoot root, org.jboss.managed.api.ManagedObject parent, org.jboss.managed.api.ManagedComponent component)
          Remove a ManagedComponent.
 ComponentMapper removeComponentMapper(ComponentMapper mapper)
          UnInstallCallback for removing a component mapper.
 void removePersistencePlugin(ManagedObjectPersistencePlugin plugin)
          UnInstallCallback for removing a persistence plugin.
 PersistenceRoot resetComponent(PersistenceRoot root, org.jboss.managed.api.ManagedObject parent, org.jboss.managed.api.ManagedComponent component)
          Reset a component.
 void restorePersistenceRoot(PersistenceRoot root, Object parentAttachment, ClassLoader classLoader)
          Apply the persisted information to a attachment.
 PersistenceRoot updateComponent(PersistenceRoot root, org.jboss.managed.api.ManagedObject parent, org.jboss.managed.api.ManagedComponent component)
          Update a ManagedComponent.
 
Methods inherited from class org.jboss.system.server.profileservice.persistence.PersistenceFactory
addComponent, getManagedObjectFactory, removeComponent, updateComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPersistenceFactory

public AbstractPersistenceFactory()

AbstractPersistenceFactory

public AbstractPersistenceFactory(org.jboss.managed.api.factory.ManagedObjectFactory managedObjectFactory)
Method Detail

getPersistencePlugin

public ManagedObjectPersistencePlugin getPersistencePlugin()
Get the persistence plugin.

Specified by:
getPersistencePlugin in class PersistenceFactory
Returns:
the persistence plugin

restorePersistenceRoot

public void restorePersistenceRoot(PersistenceRoot root,
                                   Object parentAttachment,
                                   ClassLoader classLoader)
Apply the persisted information to a attachment.

Specified by:
restorePersistenceRoot in class PersistenceFactory
Parameters:
root - the persistence root
attachment - the root attachment
classLoader - the classloader

addComponent

public PersistenceRoot addComponent(PersistenceRoot root,
                                    org.jboss.managed.api.ManagedObject parent,
                                    org.jboss.managed.api.ManagedComponent component)
Add a ManagedComponent.

Specified by:
addComponent in class PersistenceFactory
Parameters:
root - the persistence root
parent - the parent managed object
component - the managed component
Returns:
the updated persistence root

removeComponent

public PersistenceRoot removeComponent(PersistenceRoot root,
                                       org.jboss.managed.api.ManagedObject parent,
                                       org.jboss.managed.api.ManagedComponent component)
Remove a ManagedComponent.

Specified by:
removeComponent in class PersistenceFactory
Parameters:
root - the persistence root
parent - the parent managed object
component - the managed component
Returns:
the updated persistence root

updateComponent

public PersistenceRoot updateComponent(PersistenceRoot root,
                                       org.jboss.managed.api.ManagedObject parent,
                                       org.jboss.managed.api.ManagedComponent component)
Update a ManagedComponent.

Specified by:
updateComponent in class PersistenceFactory
Parameters:
root - the persistence root
parent - the parent managed object
component - the managed component
Returns:
the updated persistence root

resetComponent

public PersistenceRoot resetComponent(PersistenceRoot root,
                                      org.jboss.managed.api.ManagedObject parent,
                                      org.jboss.managed.api.ManagedComponent component)
Reset a component. This will remove the persisted information.

Specified by:
resetComponent in class PersistenceFactory
Parameters:
root - the persistence root
parent - the parent managed object
component - the managed component
Returns:
the updated persistence root

addPersistedComponent

protected PersistenceRoot addPersistedComponent(PersistenceRoot root,
                                                PersistedComponent component)
Add a persisted component to the root. This will map and override existing components.

Parameters:
root - the persistence root
component - the persisted component
Returns:
the update persistence root

getComponentMapper

protected ComponentMapper getComponentMapper(org.jboss.managed.api.ManagedObject parent)
Get the component mapper for a given ManagedObject.

Parameters:
parent - the managed object
Returns:
the component mapper
Throws:
IllegalStateException - if no mapper is registered for this type

getComponentMapper

protected ComponentMapper getComponentMapper(PersistenceRoot root)
Get the component mapper for a persistence root.

Parameters:
root - the persistence root
Returns:
the component mapper
Throws:
IllegalStateException - if no mapper is registered for this type

getComponentMapper

protected ComponentMapper getComponentMapper(String type)
Get the component mapper for a given type.

Parameters:
type - the type
Returns:
the component mapper, null if not registered

mapComponents

protected static Map<String,PersistedComponent> mapComponents(PersistenceRoot root)
Map the components based on their names.

Parameters:
root - the persistence root
Returns:
a map of persisted components

addComponentMapper

public void addComponentMapper(ComponentMapper mapper)
InstallCallback for adding a component mapper.

Parameters:
mapper - the component mapper

removeComponentMapper

public ComponentMapper removeComponentMapper(ComponentMapper mapper)
UnInstallCallback for removing a component mapper.

Parameters:
mapper - the component mapper
Returns:
the removed component mapper

addPersistencePlugin

public void addPersistencePlugin(ManagedObjectPersistencePlugin plugin)
InstallCallback for adding a persistence plugin.

Parameters:
plugin - the persistence plugin

removePersistencePlugin

public void removePersistencePlugin(ManagedObjectPersistencePlugin plugin)
UnInstallCallback for removing a persistence plugin.

Parameters:
plugin - the plugin


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