com.sun.enterprise.module.bootstrap
Class PlatformMain

java.lang.Object
  extended by com.sun.enterprise.module.bootstrap.PlatformMain

public abstract class PlatformMain
extends Object

Useful delegation model for starting a hk2 instance using a service based lookup

Author:
Jerome Dochez

Field Summary
protected  Logger logger
           
protected  File root
           
 
Constructor Summary
PlatformMain()
           
 
Method Summary
<T> T
getContext(Class<T> contextType)
           
 List<Object> getContexts()
           
 Logger getLogger()
           
abstract  String getName()
          Returns the platform name associated with this main.
<T> T
getStartedService(Class<T> serviceType)
          Optional method.
 void setContext(Object context)
           
 void setLogger(Logger logger)
           
abstract  void start(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
 

Field Detail

logger

protected Logger logger

root

protected File root
Constructor Detail

PlatformMain

public PlatformMain()
Method Detail

getLogger

public Logger getLogger()

setLogger

public void setLogger(Logger logger)

setContext

public void setContext(Object context)

getContext

public <T> T getContext(Class<T> contextType)

getContexts

public List<Object> getContexts()

getName

public abstract String getName()
Returns the platform name associated with this main.

Returns:
ther plaform name

start

public abstract void start(Properties ctx)
                    throws 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:
Exception - if anything goes wrong

getStartedService

public <T> T getStartedService(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 © 2013 Oracle Corporation. All Rights Reserved.