org.objectweb.easybeans.deployable.archive
Class ArchiveManager

java.lang.Object
  extended by org.objectweb.easybeans.deployable.archive.ArchiveManager

public final class ArchiveManager
extends java.lang.Object

Creates an archive for the given type.

Author:
Florent Benoit

Field Summary
private static ArchiveManager archiveManager
          Unique instance of this class.
private  java.util.Map<java.lang.Class,EZBArchiveFactory> factories
          Mapping between class and the associated factories.
ie : File <--> DefaultArchiveFactory.
private static JLog logger
          Logger.
 
Constructor Summary
private ArchiveManager()
          Private constructor as only one instance is built.
 
Method Summary
 void addFactory(EZBArchiveFactory factory)
          Adds the given factory on this manager.
 EZBArchive getArchive(java.lang.Object o)
          Creates an EZBArchive implementation object for the given object.
static ArchiveManager getInstance()
          Gets the unique instance of this class.
private  java.lang.Class getSupportedType(java.lang.Class factoryClass)
          Determines the type supported by the given factory Class object.
 void removeFactory(EZBArchiveFactory factory)
          Removes the given factory on this manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


archiveManager

private static ArchiveManager archiveManager
Unique instance of this class.


factories

private java.util.Map<java.lang.Class,EZBArchiveFactory> factories
Mapping between class and the associated factories.
ie : File <--> DefaultArchiveFactory.

Constructor Detail

ArchiveManager

private ArchiveManager()
Private constructor as only one instance is built.

Method Detail

getInstance

public static ArchiveManager getInstance()
Gets the unique instance of this class.

Returns:
the unique instance.

addFactory

public void addFactory(EZBArchiveFactory factory)
Adds the given factory on this manager. It will look the generic info used by this class to find the class object managed by this factory.

Parameters:
factory - the factory to add.

getSupportedType

private java.lang.Class getSupportedType(java.lang.Class factoryClass)
Determines the type supported by the given factory Class object. It will look the generic info used by this class to find the class object managed by this factory.

Parameters:
factoryClass - EZBArchiveFactory sub Class.
Returns:
Returns the type supported by the given factory Class object.

removeFactory

public void removeFactory(EZBArchiveFactory factory)
Removes the given factory on this manager. It will look the generic info used by this class to find the class object managed by this factory.

Parameters:
factory - the factory to remove.

getArchive

public EZBArchive getArchive(java.lang.Object o)
Creates an EZBArchive implementation object for the given object.

Parameters:
o - object to wrap into an EZBArchive.
Returns:
the created archive.