org.apache.felix.ipojo.api
Class PrimitiveComponentType

java.lang.Object
  extended by org.apache.felix.ipojo.api.ComponentType
      extended by org.apache.felix.ipojo.api.PrimitiveComponentType
Direct Known Subclasses:
SingletonComponentType

public class PrimitiveComponentType
extends ComponentType

Allows defining primitive component types.

Author:
Felix Project Team

Constructor Summary
PrimitiveComponentType()
           
 
Method Summary
 PrimitiveComponentType addDependency(Dependency dep)
          Adds a service dependency.
 PrimitiveComponentType addDependency(TemporalDependency dep)
          Adds a temporal service dependency.
 PrimitiveComponentType addHandler(HandlerConfiguration handler)
          Adds an HandlerConfiguration to the component type.
 PrimitiveComponentType addProperty(Property prop)
          Adds a configuration property.
 PrimitiveComponentType addProperty(String key, Object obj)
          Adds a configuration property.
 PrimitiveComponentType addService(Service svc)
          Adds a provided service.
 Factory getFactory()
          Gets the component factory.
 PrimitiveComponentType setBundleContext(BundleContext bc)
          Sets the bundle context.
 PrimitiveComponentType setClassName(String classname)
          Sets the implementation class.
 PrimitiveComponentType setComponentTypeName(String name)
          Sets the component type name.
 PrimitiveComponentType setComponentTypeVersion(String version)
          Sets the component type version.
 PrimitiveComponentType setFactoryMethod(String method)
          Sets the dependency factory method.
 PrimitiveComponentType setImmediate(boolean immediate)
          Sets if the component type is immediate or not.
 PrimitiveComponentType setInvalidateMethod(String method)
          Sets the invalidate method.
 PrimitiveComponentType setManagedServicePID(String pid)
          Sets the managed service pid.
 PrimitiveComponentType setPropagation(boolean propagation)
          Sets if the component type propagates properties to service properties.
 PrimitiveComponentType setPublic(boolean visible)
          Sets the factory public aspect.
 PrimitiveComponentType setUpdatedMethod(String method)
          Sets the updated method.
 PrimitiveComponentType setValidateMethod(String method)
          Sets the validate method.
 void start()
          Starts the component type.
 void stop()
          Stops the component type.
 
Methods inherited from class org.apache.felix.ipojo.api.ComponentType
createInstance, createInstance, createInstance, disposeInstance, disposeInstance, getInstanceByName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveComponentType

public PrimitiveComponentType()
Method Detail

getFactory

public Factory getFactory()
Gets the component factory.

Specified by:
getFactory in class ComponentType
Returns:
the factory attached to this component type.
See Also:
ComponentType.getFactory()

start

public void start()
Starts the component type.

Specified by:
start in class ComponentType
See Also:
ComponentType.start()

stop

public void stop()
Stops the component type.

Specified by:
stop in class ComponentType
See Also:
ComponentType.stop()

setBundleContext

public PrimitiveComponentType setBundleContext(BundleContext bc)
Sets the bundle context.

Parameters:
bc - the bundle context
Returns:
the current component type

setClassName

public PrimitiveComponentType setClassName(String classname)
Sets the implementation class.

Parameters:
classname - the class name
Returns:
the current component type

setComponentTypeName

public PrimitiveComponentType setComponentTypeName(String name)
Sets the component type name.

Parameters:
name - the factory name
Returns:
the current component type

setComponentTypeVersion

public PrimitiveComponentType setComponentTypeVersion(String version)
Sets the component type version.

Parameters:
version - the factory version or "bundle" to use the bundle version.
Returns:
the current component type

setImmediate

public PrimitiveComponentType setImmediate(boolean immediate)
Sets if the component type is immediate or not.

Parameters:
immediate - true to set the component type to immediate
Returns:
the current component type

setFactoryMethod

public PrimitiveComponentType setFactoryMethod(String method)
Sets the dependency factory method.

Parameters:
method - the method used to create pojo object.
Returns:
the current component type

setPropagation

public PrimitiveComponentType setPropagation(boolean propagation)
Sets if the component type propagates properties to service properties.

Parameters:
propagation - true to enable propagation
Returns:
the current component type

setPublic

public PrimitiveComponentType setPublic(boolean visible)
Sets the factory public aspect.

Parameters:
visible - false to create a private factory.
Returns:
the current component type

setManagedServicePID

public PrimitiveComponentType setManagedServicePID(String pid)
Sets the managed service pid.

Parameters:
pid - the managed service pid
Returns:
the current component type

setValidateMethod

public PrimitiveComponentType setValidateMethod(String method)
Sets the validate method.

Parameters:
method - the validate method
Returns:
the current component type

setInvalidateMethod

public PrimitiveComponentType setInvalidateMethod(String method)
Sets the invalidate method.

Parameters:
method - the invalidate method
Returns:
the current component type

setUpdatedMethod

public PrimitiveComponentType setUpdatedMethod(String method)
Sets the updated method.

Parameters:
method - the updated method
Returns:
the current component type

addHandler

public PrimitiveComponentType addHandler(HandlerConfiguration handler)
Adds an HandlerConfiguration to the component type. Each component type implementation must uses the populated list (m_handlers) when generating the component metadata.

Parameters:
handler - the handler configuration to add
Returns:
the current component type

addService

public PrimitiveComponentType addService(Service svc)
Adds a provided service.

Parameters:
svc - the service to add
Returns:
the current component type

addDependency

public PrimitiveComponentType addDependency(Dependency dep)
Adds a service dependency.

Parameters:
dep - the dependency to add
Returns:
the current component type

addDependency

public PrimitiveComponentType addDependency(TemporalDependency dep)
Adds a temporal service dependency.

Parameters:
dep - the temporal dependency to add
Returns:
the current component type

addProperty

public PrimitiveComponentType addProperty(Property prop)
Adds a configuration property.

Parameters:
prop - the property to add
Returns:
the current component type

addProperty

public PrimitiveComponentType addProperty(String key,
                                          Object obj)
Adds a configuration property.

Parameters:
key - the key
obj - the value (can be null)
Returns:
the current component type


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.