org.apache.openejb.client
Class ClientInstance

java.lang.Object
  extended by org.apache.openejb.client.ClientInstance

public class ClientInstance
extends java.lang.Object


Method Summary
static ClientInstance get()
           
<T> T
getComponent(java.lang.Class<T> type)
          Gets a global component instance.
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String key)
           
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
           
 long getStartTime()
           
 boolean hasProperty(java.lang.String propName)
           
<T> T
removeComponent(java.lang.Class<T> type)
          Removes a global component instance.
<T> T
setComponent(java.lang.Class<T> type, T component)
          Registers a component instance with the client, so it may be reference globally.
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStartTime

public long getStartTime()

getProperties

public java.util.Properties getProperties()

getProperty

public java.lang.String getProperty(java.lang.String key)

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)

hasProperty

public boolean hasProperty(java.lang.String propName)
Parameters:
propName - property name
Returns:
true when property is set; false otherwise

getComponent

public <T> T getComponent(java.lang.Class<T> type)
Gets a global component instance.

Parameters:
type - the class type of the component - required
Returns:
the object associated with the class type or null
Throws:
java.lang.IllegalStateException - of the component isn't found

removeComponent

public <T> T removeComponent(java.lang.Class<T> type)
Removes a global component instance.

Parameters:
type - the class type of the component - required
Returns:
the component instance or null if component type was not registered

setComponent

public <T> T setComponent(java.lang.Class<T> type,
                          T component)
Registers a component instance with the client, so it may be reference globally.

Parameters:
type - the class type of the component - required
component - the component instance

get

public static ClientInstance get()


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.