org.openpermis.editor.policy.configuration
Interface ComponentFactory

All Known Subinterfaces:
Configuration
All Known Implementing Classes:
BasicComponentFactory, BasicConfiguration, PolicyViewConfiguration

public interface ComponentFactory

Component factory interface for a pico container based factory.

Since:
0.9.0

Method Summary
 boolean canCreate(TypeKey typeKey)
          Check if this factory can create components of the given type.
<T> T
create(Class<?> type, State... context)
          Creates a component.
<T> T
create(TypeKey typeKey, State... context)
          Creates a typed component.
<T> List<T>
instances(Class<T> type)
          Returns a list of all instances of a specific type stored at the factory.
 

Method Detail

create

<T> T create(Class<?> type,
             State... context)
Creates a component.

The context state supplied is used to fill in missing parameters that are not available as default instances or implementations at the factory.

Type Parameters:
T - the component type, has to correspond to the scope of the type key.
Parameters:
type - the class for which to create the component.
context - additional state to inject to the component created.
Returns:
the component created.
Since:
0.9.0

create

<T> T create(TypeKey typeKey,
             State... context)
Creates a typed component.

The context state supplied is used to fill in missing parameters that are not available as default instances or implementations at the factory.

Type Parameters:
T - the component type, has to correspond to the scope of the type key.
Parameters:
typeKey - the type key for which to create the component.
context - additional state to inject to the component created.
Returns:
the component created.
Since:
0.9.0

canCreate

boolean canCreate(TypeKey typeKey)
Check if this factory can create components of the given type.

Parameters:
typeKey - the type key for which to check if the factory can create an instance.
Returns:
true if the factory can provide an instance, false otherwise.
Since:
0.9.0

instances

<T> List<T> instances(Class<T> type)
Returns a list of all instances of a specific type stored at the factory.

Take care to use this method only to retrieve cached instances otherwise this factory will create an instance for each of the registered implementation types that are assignable to the type specified.

Type Parameters:
T - the instance type to retrieve.
Parameters:
type - the class of the instance type to retrieve.
Returns:
the list of all known instances, never null but may be empty.
Since:
0.9.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG