org.apache.muse.core.platform.osgi
Class OSGiEnvironmentImpl

java.lang.Object
  extended by org.apache.muse.core.AbstractEnvironment
      extended by org.apache.muse.core.platform.osgi.OSGiEnvironmentImpl
All Implemented Interfaces:
Environment, OSGiEnvironment

public class OSGiEnvironmentImpl
extends AbstractEnvironment
implements OSGiEnvironment

OSGiEnvironmentImpl the implementation of the Muse platform Environment for an OSGi deployment

Author:
Joel Hawkins (joelh)

Field Summary
protected  ThreadLocal localEnvironmentContext
           
 
Constructor Summary
OSGiEnvironmentImpl(boolean createSoapClient)
          constructor for OSGiEnvironmentImpl
 
Method Summary
 InputStream getDataResourceStream(String path)
          gets an InputStream for a given path relative to the currently executing Bundle.
 EndpointReference getDeploymentEPR()
          method not implemented for the OSGi environment
 File getRealDirectory()
          method not implemented for the OSGi environment
 org.osgi.framework.Bundle getThreadLocalBundle()
          gets the environment's bundle context for the currently executing thread.
 void setThreadLocalBundle(org.osgi.framework.Bundle bundle)
          sets the environment's bundle context for the currently executing thread
 
Methods inherited from class org.apache.muse.core.AbstractEnvironment
addAddressingContext, createRelativePath, createSoapClient, getAddressingContext, getClassLoader, getDataResource, getDefaultEPR, getDefaultURI, getDeploymentURI, getDocument, getSoapClient, removeAddressingContext, setDefaultURI, setSoapClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.muse.core.Environment
addAddressingContext, createRelativePath, getAddressingContext, getClassLoader, getDataResource, getDefaultURI, getDocument, getSoapClient, removeAddressingContext, setDefaultURI, setSoapClient
 

Field Detail

localEnvironmentContext

protected ThreadLocal localEnvironmentContext
Constructor Detail

OSGiEnvironmentImpl

public OSGiEnvironmentImpl(boolean createSoapClient)
constructor for OSGiEnvironmentImpl

Parameters:
createSoapClient -
See Also:
AbstractEnvironment.AbstractEnvironment(boolean)
Method Detail

getDeploymentEPR

public EndpointReference getDeploymentEPR()
method not implemented for the OSGi environment

Specified by:
getDeploymentEPR in interface Environment
Returns:
The copy of the EPR of the application, as viewed in the context of the current request. When multiple endpoints are mapped to one application/service, this method will return different EPRs from request to request. Muse uses this feature to host different resource types (with different endpoints) in the same application or bundle.

getRealDirectory

public File getRealDirectory()
method not implemented for the OSGi environment

Specified by:
getRealDirectory in interface Environment
Returns:
The actual directory on the file system where the application is deployed.

getThreadLocalBundle

public org.osgi.framework.Bundle getThreadLocalBundle()
gets the environment's bundle context for the currently executing thread.

Specified by:
getThreadLocalBundle in interface OSGiEnvironment
Returns:
the Bundle corresponding to the caller's execution context.

setThreadLocalBundle

public void setThreadLocalBundle(org.osgi.framework.Bundle bundle)
sets the environment's bundle context for the currently executing thread

Specified by:
setThreadLocalBundle in interface OSGiEnvironment
Parameters:
bundle - the Bundle to be used by the currently executing thread

getDataResourceStream

public InputStream getDataResourceStream(String path)
gets an InputStream for a given path relative to the currently executing Bundle.

Specified by:
getDataResourceStream in interface Environment
Overrides:
getDataResourceStream in class AbstractEnvironment
Parameters:
path - the path used in the getResource call.
Returns:
the InputStream corresponding to the path, or null if not found.
See Also:
Environment.getDataResourceStream(String)


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.