com.sun.enterprise.module.bootstrap
Class PlatformMain
java.lang.Object
com.sun.enterprise.module.bootstrap.PlatformMain
public abstract class PlatformMain
- extends java.lang.Object
Useful delegation model for starting a hk2 instance using a service based
lookup
- Author:
- Jerome Dochez
|
Field Summary |
protected java.util.logging.Logger |
logger
|
protected java.io.File |
root
|
|
Method Summary |
|
getContext(java.lang.Class<T> contextType)
|
java.util.List<java.lang.Object> |
getContexts()
|
java.util.logging.Logger |
getLogger()
|
abstract java.lang.String |
getName()
Returns the platform name associated with this main. |
|
getStartedService(java.lang.Class<T> serviceType)
Optional method. |
void |
setContext(java.lang.Object context)
|
void |
setLogger(java.util.logging.Logger logger)
|
abstract void |
start(java.util.Properties ctx)
Starts the main entry point using this platform implementation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected java.util.logging.Logger logger
root
protected java.io.File root
PlatformMain
public PlatformMain()
getLogger
public java.util.logging.Logger getLogger()
setLogger
public void setLogger(java.util.logging.Logger logger)
setContext
public void setContext(java.lang.Object context)
getContext
public <T> T getContext(java.lang.Class<T> contextType)
getContexts
public java.util.List<java.lang.Object> getContexts()
getName
public abstract java.lang.String getName()
- Returns the platform name associated with this main.
- Returns:
- ther plaform name
start
public abstract void start(java.util.Properties ctx)
throws java.lang.Exception
- Starts the main entry point using this platform implementation.
- Parameters:
ctx - Context in which this object executes. It contains arguments passed to the program as well.
- Throws:
java.lang.Exception - if anything goes wrong
getStartedService
public <T> T getStartedService(java.lang.Class<T> serviceType)
- Optional method.
Returns singleton services after the start method was executed successfully.
- Type Parameters:
T - service type- Parameters:
serviceType - type of the requested service
- Returns:
- service instance
Copyright © 2012 Oracle Corporation. All Rights Reserved.