com.sun.enterprise.deployment.archivist
Class ApplicationFactory

java.lang.Object
  extended by com.sun.enterprise.deployment.archivist.ApplicationFactory
All Implemented Interfaces:
ContractProvider

@Service
public class ApplicationFactory
extends java.lang.Object
implements ContractProvider

Factory for application object

Author:
Jerome Dochez

Field Summary
protected static java.util.logging.Logger logger
           
 
Constructor Summary
ApplicationFactory()
           
 
Method Summary
 Application createApplicationFromStandardDD(ReadableArchive archive)
          This method creates an Application object from reading the standard deployment descriptor.
 java.lang.String getApplicationName(java.io.File jarFile)
           
 Application openArchive(Archivist archivist, ReadableArchive in, boolean handleRuntimeInfo)
          Open a jar file and return an application object for the modules contained in the archive.
 Application openArchive(Archivist archivist, java.net.URI jarFile, boolean handleRuntimeInfo)
          Open a jar file and return an application object for the modules contained in the archive/directory.
 Application openArchive(java.lang.String appName, Archivist archivist, ReadableArchive in, boolean handleRuntimeInfo)
          Open a jar file and return an application object for the modules contained in the archive.
 Application openArchive(java.net.URI jarFile)
          Open a jar file and return an application object for the modules contained in the archive.
 Application openArchive(java.net.URI jarFile, boolean handleRuntimeInfo)
          Open a jar file with the default Archivists and return an application object for the modules contained in the archive.
 Application openWith(Application application, ReadableArchive archive, Archivist archivist)
          This method populates the rest of the Application object from the previous standard deployment descriptor reading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger
Constructor Detail

ApplicationFactory

public ApplicationFactory()
Method Detail

openArchive

public Application openArchive(java.net.URI jarFile)
                        throws java.io.IOException,
                               org.xml.sax.SAXParseException
Open a jar file and return an application object for the modules contained in the archive. If the archive is a standalone module, this API will create an empty application and add the standalone module to it

Parameters:
jarFile - the archive file
Returns:
the application object
Throws:
java.io.IOException
org.xml.sax.SAXParseException

openArchive

public Application openArchive(Archivist archivist,
                               java.net.URI jarFile,
                               boolean handleRuntimeInfo)
                        throws java.io.IOException,
                               org.xml.sax.SAXParseException
Open a jar file and return an application object for the modules contained in the archive/directory. If the archive/directory is a standalone module, this API will create an empty application and add the standalone module to it

Parameters:
archivist - to use to open the archive file
jarFile - the archive file
handleRuntimeInfo - set to true to read configuration deployment descriptors
Returns:
the application object
Throws:
java.io.IOException
org.xml.sax.SAXParseException

openArchive

public Application openArchive(Archivist archivist,
                               ReadableArchive in,
                               boolean handleRuntimeInfo)
                        throws java.io.IOException,
                               org.xml.sax.SAXParseException
Open a jar file and return an application object for the modules contained in the archive. If the archive is a standalone module, this API will create an empty application and add the standalone module to it

Parameters:
archivist - to use to open the archive file
in - the archive abstraction
handleRuntimeInfo - true to read configuration deployment descriptors
Returns:
the application object
Throws:
java.io.IOException
org.xml.sax.SAXParseException

openArchive

public Application openArchive(java.lang.String appName,
                               Archivist archivist,
                               ReadableArchive in,
                               boolean handleRuntimeInfo)
                        throws java.io.IOException,
                               org.xml.sax.SAXParseException
Open a jar file and return an application object for the modules contained in the archive. If the archive is a standalone module, this API will create an empty application and add the standalone module to it

Parameters:
appName - the application moduleID
archivist - to use to open the archive file
in - the input archive
handleRuntimeInfo - set to true to read configuration deployment descriptors
Returns:
the application object
Throws:
java.io.IOException
org.xml.sax.SAXParseException

createApplicationFromStandardDD

public Application createApplicationFromStandardDD(ReadableArchive archive)
                                            throws java.io.IOException,
                                                   org.xml.sax.SAXParseException
This method creates an Application object from reading the standard deployment descriptor.

Parameters:
archive - the archive for the application
Throws:
java.io.IOException
org.xml.sax.SAXParseException

openWith

public Application openWith(Application application,
                            ReadableArchive archive,
                            Archivist archivist)
                     throws java.io.IOException,
                            org.xml.sax.SAXParseException
This method populates the rest of the Application object from the previous standard deployment descriptor reading

Parameters:
archive - the archive for the application
Throws:
java.io.IOException
org.xml.sax.SAXParseException

openArchive

public Application openArchive(java.net.URI jarFile,
                               boolean handleRuntimeInfo)
                        throws java.io.IOException,
                               org.xml.sax.SAXParseException
Open a jar file with the default Archivists and return an application object for the modules contained in the archive. If the archive is a standalone module, this API will create an empty application and add the standalone module to it

Parameters:
jarFile - the archive file
handleRuntimeInfo - set to true to read configuration deployment descriptors
Returns:
the application object
Throws:
java.io.IOException
org.xml.sax.SAXParseException

getApplicationName

public java.lang.String getApplicationName(java.io.File jarFile)
                                    throws java.io.IOException
Parameters:
jarFile - the .ear file
Returns:
the application name from an application .ear file
Throws:
java.io.IOException


Copyright © 2012 GlassFish Community. All Rights Reserved.