com.codemonster.surinam.core.framework
Interface BlueprintManager

All Known Implementing Classes:
BlueprintManagerImpl

public interface BlueprintManager

Caution: this class is normally internal to a ServiceBlock and not explicitly instantiated. The correct way to acquire a BPM object reference is via the ServiceBlockAdmin API.

BlueprintManager bpm = theServiceBlock.getBlueprintMgr();

This is the primary API for maintaining detailed runtime meta-data that reflects the current state of the Service Graph which is maintained in the Service Directory. This will include runtime information stored in blueprints that comes from action docs, annotations and other sources.

The ServiceBlock works from "blueprints" that specify how to build each service along with binding instructions for implementations. The BlueprintManager is responsible for maintaining this blueprint 'meta' model that represents a synchronized view of the object model in the Service Directory. While most other container technology tends to throw this information away once the model is built, Surinam preserves most of the original blueprint information and extends it through updates that are driven from the encapsulating Service Block. Since the service model is an abstraction of the Service Graph, should the graph be reshaped at runtime, the blueprint meta-model will no longer be in synch. When this happens the Blueprint Manager will receive instructions to add services or to perform other mapping changes. For implemenation mapping changes, it becomes simpler to wait until all the mapping changes have been made to the Service Graph and then call 'synchronizeBindings' which brings the meta-model to parity.

The BPM also offers the ability to fully describe its meta-model, in the most portable and descriptive format available, which means an Action Document. To restate this point, the BPM has the ability to use all that stored information to generate a fully-formed Action Document that fully represents the current organizational state of the Service Graph. This document can then be persisted, broadcast or otherwise reused to restore the organizational state of the SB.

See Also:
synchronizeBindings(com.codemonster.surinam.export.framework.ServiceBlockAdmin), ServiceBlock, ServiceBlockCommander

Method Summary
 boolean isRegisteredContract(String contractName)
          Tells whether a contract is registered with the manager.
 boolean isRegisteredEntryPoint(String contractName)
          Tells whether a contract is registered with the manager.
 boolean isRegisteredImplementation(String contractName)
          Tells whether a contract is registered with the manager.
 void registerEntryPoint(EntryPointBlueprint blueprint)
          Registers an entry point with the BPM.
 void registerProviderImplementation(ImplementationBlueprint blueprint)
          Registers an implementation with the BPM.
 void registerServiceContract(ContractBlueprint blueprint)
          Registers a Contract with the BPM.
 String renderActionDocument()
          This method is a primary format since the XML it delivers is actually a valid Action Document that can be fed back into a Service Block via a ServiceBlockCommander.
 void reset()
          This method causes the manager to flush its mappings and reset to the state it was in when first created.
 void retireImplementation(String contractName)
          This directive will remove a Service Provider Implementation from the manager.
 void retireServiceContract(String contractName)
          This directive will remove a Service Contract from the manager.
 void synchronizeBindings(ServiceBlockAdmin serviceBlockAdmin)
          Rather than try to maintain synchronization with the Service Directory for every change to the block (made even more complicated by implementation binding changes), we take the administrative interface for the Service Block and reconcile the service directory state with the blueprints from the BPM, bringing the meta-model into parity with the Service Graph and the Service Block.
 String toHTML()
          Instructs the Blueprint Manager to return its current state as an HTML-formatted document.
 

Method Detail

registerServiceContract

void registerServiceContract(ContractBlueprint blueprint)
Registers a Contract with the BPM.

Parameters:
blueprint - The blueprint to be registered with the BPM.

retireServiceContract

void retireServiceContract(String contractName)
This directive will remove a Service Contract from the manager. Note that an Entry Point is a type of Service Contract so this method will retire either an Entry Point or a Service Contract since there can only be one with the given name.

Parameters:
contractName - Name of the contract to be retired.

retireImplementation

void retireImplementation(String contractName)
This directive will remove a Service Provider Implementation from the manager.

Parameters:
contractName - Name of the Implementation to be removed.

registerEntryPoint

void registerEntryPoint(EntryPointBlueprint blueprint)
Registers an entry point with the BPM.

Parameters:
blueprint - The blueprint to be registered with the BPM.

registerProviderImplementation

void registerProviderImplementation(ImplementationBlueprint blueprint)
Registers an implementation with the BPM.

Parameters:
blueprint - The blueprint to be registered with the BPM.

isRegisteredEntryPoint

boolean isRegisteredEntryPoint(String contractName)
Tells whether a contract is registered with the manager.

Parameters:
contractName - The name of the contract being queried.
Returns:
Returns whether or not the contract is registered.

isRegisteredContract

boolean isRegisteredContract(String contractName)
Tells whether a contract is registered with the manager.

Parameters:
contractName - The name of the contract being queried.
Returns:
Returns whether or not the contract is registered.

isRegisteredImplementation

boolean isRegisteredImplementation(String contractName)
Tells whether a contract is registered with the manager.

Parameters:
contractName - The name of the contract being queried.
Returns:
Returns whether or not the contract is registered.

synchronizeBindings

void synchronizeBindings(ServiceBlockAdmin serviceBlockAdmin)
                         throws ClassNotFoundException
Rather than try to maintain synchronization with the Service Directory for every change to the block (made even more complicated by implementation binding changes), we take the administrative interface for the Service Block and reconcile the service directory state with the blueprints from the BPM, bringing the meta-model into parity with the Service Graph and the Service Block.

Parameters:
serviceBlockAdmin - The service directory admin instance to synchronize against.
Throws:
ClassNotFoundException - Thrown if there is a processing failure.

renderActionDocument

String renderActionDocument()
This method is a primary format since the XML it delivers is actually a valid Action Document that can be fed back into a Service Block via a ServiceBlockCommander. This is valuable since it represents the current state of the block and will account for any number of Action Doc Upgrades performed to date. As it is an Action Doc, it is suitable for persistence, should you wish to bring the system down and be able to reconsitute the deployed state of the block based on that snapshot.

Note that an Action Document does not capture internal data, only the organizational state of the Service Graph, Directory Service and the BlueprintManager... which is essentially the Service Block as a whole.

Returns:
Returns the Action Document representing the current state of the Service Graph.
See Also:
ServiceBlockCommander

toHTML

String toHTML()
Instructs the Blueprint Manager to return its current state as an HTML-formatted document.

Returns:
Returns the HTML representing the current state of the SB.

reset

void reset()
This method causes the manager to flush its mappings and reset to the state it was in when first created.



Copyright © 2010. All Rights Reserved.