org.apache.felix.ipojo.api

## Class PrimitiveComponentType

- java.lang.Object
- - org.apache.felix.ipojo.api.ComponentType
  - - 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

Constructors
Constructor and Description
`PrimitiveComponentType()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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(java.lang.String key, java.lang.Object obj)` Adds a configuration property.
`PrimitiveComponentType` `addService(Service svc)` Adds a provided service.
`Factory` `getFactory()` Gets the component factory.
`PrimitiveComponentType` `setBundleContext(org.osgi.framework.BundleContext bc)` Sets the bundle context.
`PrimitiveComponentType` `setClassName(java.lang.String classname)` Sets the implementation class.
`PrimitiveComponentType` `setComponentTypeName(java.lang.String name)` Sets the component type name.
`PrimitiveComponentType` `setComponentTypeVersion(java.lang.String version)` Sets the component type version.
`PrimitiveComponentType` `setFactoryMethod(java.lang.String method)` Sets the dependency factory method.
`PrimitiveComponentType` `setImmediate(boolean immediate)` Sets if the component type is immediate or not.
`PrimitiveComponentType` `setInvalidateMethod(java.lang.String method)` Sets the invalidate method.
`PrimitiveComponentType` `setManagedServicePID(java.lang.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(java.lang.String method)` Sets the updated method.
`PrimitiveComponentType` `setValidateMethod(java.lang.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(org.osgi.framework.BundleContext bc)

Sets the bundle context.

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

#### setClassName

    public PrimitiveComponentType setClassName(java.lang.String classname)

Sets the implementation class.

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

#### setComponentTypeName

    public PrimitiveComponentType setComponentTypeName(java.lang.String name)

Sets the component type name.

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

#### setComponentTypeVersion

    public PrimitiveComponentType setComponentTypeVersion(java.lang.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(java.lang.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(java.lang.String pid)

Sets the managed service pid.

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

#### setValidateMethod

    public PrimitiveComponentType setValidateMethod(java.lang.String method)

Sets the validate method.

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

#### setInvalidateMethod

    public PrimitiveComponentType setInvalidateMethod(java.lang.String method)

Sets the invalidate method.

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

#### setUpdatedMethod

    public PrimitiveComponentType setUpdatedMethod(java.lang.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(java.lang.String key,
                                              java.lang.Object obj)

Adds a configuration property.

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