org.apache.tuscany.sca.implementation.osgi.context
Class OSGiAnnotations

java.lang.Object
  extended by org.apache.tuscany.sca.implementation.osgi.context.OSGiAnnotations

public class OSGiAnnotations
extends java.lang.Object

OSGi annotation processing OSGi bundles are not introspected by OSGiImplementation when a component is created. Instead if the list of implementation classes is specified in , the classes are introspected when the bundle is resolved. The classes are loaded using the bundle ClassLoader, and hence the delay in annotation processing is inevitable. There is one other difference compared to implementation.java. While instances (and the instance class) are associated with a component in Java, all Java annotations from the component implementation class apply to all the component instances. In OSGi, instances are associated with services, and a bundle can register multiple services. Hence annotations from classes need to be stored separately so that the right ones can be associated with the service instance.


Constructor Summary
OSGiAnnotations(ModelFactoryExtensionPoint modelFactories, java.lang.String[] classList, RuntimeComponent runtimeComponent, JavaPropertyValueObjectFactory propertyValueFactory, ProxyFactory proxyFactory, RequestContextFactory requestContextFactory, Bundle mainBundle, java.util.ArrayList<Bundle> dependentBundles)
           
 
Method Summary
 java.lang.reflect.Method getDestroyMethod(java.lang.Object instance)
           
 java.lang.reflect.Method getInitMethod(java.lang.Object instance)
           
 long getMaxAge()
           
 long getMaxIdleTime()
           
 Scope getScope()
           
 void injectProperties(java.lang.Object instance)
           
 boolean isAllowsPassByReference(java.lang.Object instance, java.lang.reflect.Method method)
           
 boolean isEagerInit()
           
 void processAnnotations()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSGiAnnotations

public OSGiAnnotations(ModelFactoryExtensionPoint modelFactories,
                       java.lang.String[] classList,
                       RuntimeComponent runtimeComponent,
                       JavaPropertyValueObjectFactory propertyValueFactory,
                       ProxyFactory proxyFactory,
                       RequestContextFactory requestContextFactory,
                       Bundle mainBundle,
                       java.util.ArrayList<Bundle> dependentBundles)
Method Detail

processAnnotations

public void processAnnotations()
                        throws IntrospectionException
Throws:
IntrospectionException

injectProperties

public void injectProperties(java.lang.Object instance)

getScope

public Scope getScope()

isAllowsPassByReference

public boolean isAllowsPassByReference(java.lang.Object instance,
                                       java.lang.reflect.Method method)

isEagerInit

public boolean isEagerInit()

getMaxAge

public long getMaxAge()

getMaxIdleTime

public long getMaxIdleTime()

getInitMethod

public java.lang.reflect.Method getInitMethod(java.lang.Object instance)

getDestroyMethod

public java.lang.reflect.Method getDestroyMethod(java.lang.Object instance)