org.jboss.system.server.profileservice.repository
Class TypedProfileFactory

java.lang.Object
  extended by org.jboss.system.server.profileservice.repository.AbstractProfileFactory
      extended by org.jboss.system.server.profileservice.repository.TypedProfileFactory
All Implemented Interfaces:
org.jboss.profileservice.spi.ProfileFactory

public class TypedProfileFactory
extends AbstractProfileFactory
implements org.jboss.profileservice.spi.ProfileFactory

A typed profile factory. This delegates the creation of profiles to the registered factories, based on the class name of the profile meta data.

Version:
$Revision$
Author:
Emanuel Muckenhuber

Field Summary
static Collection<String> types
          The locally handled types.
 
Constructor Summary
TypedProfileFactory()
           
 
Method Summary
 void addProfileFactory(AbstractProfileFactory factory)
          Add a profile factory.
protected  org.jboss.profileservice.spi.Profile createNoopProfile(org.jboss.profileservice.spi.ProfileKey key, org.jboss.profileservice.spi.metadata.ProfileMetaData metaData, List<org.jboss.profileservice.spi.ProfileKey> subProfiles)
          Create a empty profile.
 org.jboss.profileservice.spi.Profile createProfile(org.jboss.profileservice.spi.ProfileKey key, org.jboss.profileservice.spi.metadata.ProfileMetaData metaData, List<org.jboss.profileservice.spi.ProfileKey> subProfiles)
          This is used by the BoostrapProfileFactory, as it already created the subProfiles list.
protected  org.jboss.profileservice.spi.Profile delegateCreateProfile(String type, org.jboss.profileservice.spi.ProfileKey key, org.jboss.profileservice.spi.metadata.ProfileMetaData metaData, List<org.jboss.profileservice.spi.ProfileKey> subProfiles)
          Delegate the creation of the profile to one of the registered profile factories.
 String[] getTypes()
           
 void removeProfileFactory(AbstractProfileFactory factory)
          Remove a profile factory.
 
Methods inherited from class org.jboss.system.server.profileservice.repository.AbstractProfileFactory
createKey, createProfile, createSubProfiles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.profileservice.spi.ProfileFactory
createProfile
 

Field Detail

types

public static final Collection<String> types
The locally handled types.

Constructor Detail

TypedProfileFactory

public TypedProfileFactory()
Method Detail

getTypes

public String[] getTypes()
Specified by:
getTypes in interface org.jboss.profileservice.spi.ProfileFactory

createProfile

public org.jboss.profileservice.spi.Profile createProfile(org.jboss.profileservice.spi.ProfileKey key,
                                                          org.jboss.profileservice.spi.metadata.ProfileMetaData metaData,
                                                          List<org.jboss.profileservice.spi.ProfileKey> subProfiles)
                                                   throws Exception
Description copied from class: AbstractProfileFactory
This is used by the BoostrapProfileFactory, as it already created the subProfiles list.

Specified by:
createProfile in class AbstractProfileFactory
Parameters:
key - the profile key
metaData - the profile meta data
subProfiles - the sub profiles list
Returns:
the profile
Throws:
Exception

delegateCreateProfile

protected org.jboss.profileservice.spi.Profile delegateCreateProfile(String type,
                                                                     org.jboss.profileservice.spi.ProfileKey key,
                                                                     org.jboss.profileservice.spi.metadata.ProfileMetaData metaData,
                                                                     List<org.jboss.profileservice.spi.ProfileKey> subProfiles)
                                                              throws IllegalArgumentException,
                                                                     Exception
Delegate the creation of the profile to one of the registered profile factories.

Parameters:
type - the meta data type
key - the profile key
metaData - the profile meta data
subProfiles - the sub profiles
Returns:
the profile
Throws:
IllegalArgumentException - if there is no factory registered for the meta data type
Exception - for any error

createNoopProfile

protected org.jboss.profileservice.spi.Profile createNoopProfile(org.jboss.profileservice.spi.ProfileKey key,
                                                                 org.jboss.profileservice.spi.metadata.ProfileMetaData metaData,
                                                                 List<org.jboss.profileservice.spi.ProfileKey> subProfiles)
Create a empty profile.

Parameters:
key - the profile key
metaData - the profile meta data
subProfiles - the sub profiles
Returns:
the profile

addProfileFactory

public void addProfileFactory(AbstractProfileFactory factory)
Add a profile factory.

Parameters:
factory - the abstract profile factory to add

removeProfileFactory

public void removeProfileFactory(AbstractProfileFactory factory)
Remove a profile factory.

Parameters:
factory - the abstract profile factory to remove


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