Class AppClientInfo
- java.lang.Object
-
- org.glassfish.appclient.client.acc.AppClientInfo
-
- Direct Known Subclasses:
ClassFileAppClientInfo
,NestedAppClientInfo
,StandAloneAppClientInfo
@Service public abstract class AppClientInfo extends Object
Represents information about the app client, regardless of what type of archive (jar or directory) it is stored in or what type of module (app client or nested within an ear) that archive holds.- Author:
- tjquinn
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
_keepExplodedDir
protected Logger
_logger
loggerprotected boolean
isJWS
indicates if the app client has been launched using Java Web Startprotected String
mainClassFromCommandLine
main class name as the user specified it on the command lineprotected String
mainClassNameToRun
main class to be used - could come from the command line or from the manifest of the selected app client archivestatic String
USER_CODE_IS_SIGNED_PROPERTYNAME
-
Constructor Summary
Constructors Constructor Description AppClientInfo(boolean isJWS, Logger logger, String mainClassFromCommandLine)
Creates a new AppClientInfo for a main class file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
classContainsAnnotation(String entry, AnnotationDetector detector, ReadableArchive archive, ApplicationClientDescriptor descriptor)
protected void
close()
protected void
completeInit()
protected boolean
deleteAppClientDir()
protected boolean
descriptorContainsPURefcs(ApplicationClientDescriptor descr)
Reports whether the app client's descriptor shows a dependence on a persistence unit.protected ApplicationClientDescriptor
getAppClient()
Returns the app client descriptor to be run.protected ApplicationClientDescriptor
getAppClient(Archivist archivist)
protected String
getAppClientRoot(ReadableArchive archive, ApplicationClientDescriptor descriptor)
protected ClassLoader
getClassLoader()
protected List<String>
getClassPaths(ReadableArchive archive)
protected ApplicationClientDescriptor
getDescriptor()
protected static URL
getEntryAsUrl(File moduleLocation, String uri)
Reports whether the main class in the archive contains annotations that refer to persistence units.protected String
getLocalString(String key, String defaultMessage, Object... args)
protected String
getMainClassNameToRun(ApplicationClientDescriptor acDescr)
Returns the main class that should be executed.protected void
handlePersistenceUnitDependency()
Processes persistence unit handling for the ACC.protected void
massageDescriptor()
protected void
setDescriptor(ApplicationClientDescriptor acDesc)
String
toString()
-
-
-
Field Detail
-
USER_CODE_IS_SIGNED_PROPERTYNAME
public static final String USER_CODE_IS_SIGNED_PROPERTYNAME
- See Also:
- Constant Field Values
-
_logger
protected Logger _logger
logger
-
mainClassFromCommandLine
protected String mainClassFromCommandLine
main class name as the user specified it on the command line
-
mainClassNameToRun
protected String mainClassNameToRun
main class to be used - could come from the command line or from the manifest of the selected app client archive
-
isJWS
protected boolean isJWS
indicates if the app client has been launched using Java Web Start
-
_keepExplodedDir
protected static final boolean _keepExplodedDir
-
-
Method Detail
-
setDescriptor
protected void setDescriptor(ApplicationClientDescriptor acDesc)
-
getDescriptor
protected ApplicationClientDescriptor getDescriptor()
-
getAppClient
protected ApplicationClientDescriptor getAppClient()
Returns the app client descriptor to be run.- Returns:
- the descriptor for the selected app client
-
getClassLoader
protected ClassLoader getClassLoader()
-
close
protected void close() throws IOException
- Throws:
IOException
-
deleteAppClientDir
protected boolean deleteAppClientDir()
-
handlePersistenceUnitDependency
protected void handlePersistenceUnitDependency() throws URISyntaxException, MalformedURLException
Processes persistence unit handling for the ACC.
-
descriptorContainsPURefcs
protected boolean descriptorContainsPURefcs(ApplicationClientDescriptor descr)
Reports whether the app client's descriptor shows a dependence on a persistence unit.- Parameters:
descr
- the descriptor for the app client in question
-
getEntryAsUrl
protected static URL getEntryAsUrl(File moduleLocation, String uri) throws MalformedURLException, IOException
Reports whether the main class in the archive contains annotations that refer to persistence units.- Returns:
- boolean if the main class contains annotations that refer to a pers. unit
- Throws:
MalformedURLException
IOException
-
getAppClient
protected ApplicationClientDescriptor getAppClient(Archivist archivist)
-
getAppClientRoot
protected String getAppClientRoot(ReadableArchive archive, ApplicationClientDescriptor descriptor)
-
massageDescriptor
protected void massageDescriptor() throws IOException, AnnotationProcessorException
-
getClassPaths
protected List<String> getClassPaths(ReadableArchive archive)
-
getMainClassNameToRun
protected String getMainClassNameToRun(ApplicationClientDescriptor acDescr)
Returns the main class that should be executed.- Returns:
- the name of the main class to execute when the client starts
-
classContainsAnnotation
protected boolean classContainsAnnotation(String entry, AnnotationDetector detector, ReadableArchive archive, ApplicationClientDescriptor descriptor) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
-