com.codemonster.surinam.core.framework
Class BlueprintManagerImpl

java.lang.Object
  extended by com.codemonster.surinam.core.framework.BlueprintManagerImpl
All Implemented Interfaces:
BlueprintManager

public class BlueprintManagerImpl
extends Object
implements BlueprintManager

This is the primary implementation for the BlueprintManager. Among other things, the this instance has injection methods for changing the output renderers.

See Also:
BlueprintManager

Constructor Summary
BlueprintManagerImpl()
           
 
Method Summary
 AbstractContractBlueprintFormatter getContractFormatter()
           
 AbstractEntryPointBlueprintFormatter getEntryPointFormatter()
           
 AbstractImplementationBlueprintFormatter getImplementationFormatter()
           
 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 entryPointBlueprint)
          Registers an entry point with the BPM.
 void registerProviderImplementation(ImplementationBlueprint implementationBlueprint)
          Note that the key used for an implementation is the service binding name and not the implementation name.
 void registerServiceContract(ContractBlueprint contractBlueprint)
          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)
          Recognizing that there is no difference between Contracts and Entry Points we will search both for a match.
 void setContractFormatter(AbstractContractBlueprintFormatter contractFormatter)
           
 void setEntryPointFormatter(AbstractEntryPointBlueprintFormatter entryPointFormatter)
           
 void setImplementationFormatter(AbstractImplementationBlueprintFormatter implementationFormatter)
           
 void synchronizeBindings(ServiceBlockAdmin serviceBlockAdmin)
          It is absolutely critical that the BPM maintain synchronized state with the Service Directory.
 String toHTML()
          Instructs the Blueprint Manager to return its current state as an HTML-formatted document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlueprintManagerImpl

public BlueprintManagerImpl()
Method Detail

registerServiceContract

public void registerServiceContract(ContractBlueprint contractBlueprint)
Description copied from interface: BlueprintManager
Registers a Contract with the BPM.

Specified by:
registerServiceContract in interface BlueprintManager
Parameters:
contractBlueprint - The blueprint to be registered with the BPM.

retireServiceContract

public void retireServiceContract(String contractName)
Recognizing that there is no difference between Contracts and Entry Points we will search both for a match. Since there will only be one with that name, it is pretty straightforward.

Specified by:
retireServiceContract in interface BlueprintManager
Parameters:
contractName - Name of the contract to be retired.

retireImplementation

public void retireImplementation(String contractName)
Description copied from interface: BlueprintManager
This directive will remove a Service Provider Implementation from the manager.

Specified by:
retireImplementation in interface BlueprintManager
Parameters:
contractName - Name of the Implementation to be removed.

isRegisteredEntryPoint

public boolean isRegisteredEntryPoint(String contractName)
Description copied from interface: BlueprintManager
Tells whether a contract is registered with the manager.

Specified by:
isRegisteredEntryPoint in interface BlueprintManager
Parameters:
contractName - The name of the contract being queried.
Returns:
Returns whether or not the contract is registered.

isRegisteredContract

public boolean isRegisteredContract(String contractName)
Description copied from interface: BlueprintManager
Tells whether a contract is registered with the manager.

Specified by:
isRegisteredContract in interface BlueprintManager
Parameters:
contractName - The name of the contract being queried.
Returns:
Returns whether or not the contract is registered.

isRegisteredImplementation

public boolean isRegisteredImplementation(String contractName)
Description copied from interface: BlueprintManager
Tells whether a contract is registered with the manager.

Specified by:
isRegisteredImplementation in interface BlueprintManager
Parameters:
contractName - The name of the contract being queried.
Returns:
Returns whether or not the contract is registered.

registerEntryPoint

public void registerEntryPoint(EntryPointBlueprint entryPointBlueprint)
Description copied from interface: BlueprintManager
Registers an entry point with the BPM.

Specified by:
registerEntryPoint in interface BlueprintManager
Parameters:
entryPointBlueprint - The blueprint to be registered with the BPM.

registerProviderImplementation

public void registerProviderImplementation(ImplementationBlueprint implementationBlueprint)
Note that the key used for an implementation is the service binding name and not the implementation name.

Specified by:
registerProviderImplementation in interface BlueprintManager
Parameters:
implementationBlueprint - The implementation blueprint object.

synchronizeBindings

public void synchronizeBindings(ServiceBlockAdmin serviceBlockAdmin)
It is absolutely critical that the BPM maintain synchronized state with the Service Directory. The simplest way to assure that is to go back to the directory to bring things back into coherence.

Specified by:
synchronizeBindings in interface BlueprintManager
Parameters:
serviceBlockAdmin - The service directory admin instance to synchronize against.

renderActionDocument

public 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.

Specified by:
renderActionDocument in interface BlueprintManager
Returns:
Returns the Action Document representing the current state of the Service Graph.
See Also:
ServiceBlockCommander

toHTML

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

Specified by:
toHTML in interface BlueprintManager
Returns:
Returns the HTML representing the current state of the SB.

reset

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

Specified by:
reset in interface BlueprintManager

getContractFormatter

public AbstractContractBlueprintFormatter getContractFormatter()

setContractFormatter

public void setContractFormatter(AbstractContractBlueprintFormatter contractFormatter)

getEntryPointFormatter

public AbstractEntryPointBlueprintFormatter getEntryPointFormatter()

setEntryPointFormatter

public void setEntryPointFormatter(AbstractEntryPointBlueprintFormatter entryPointFormatter)

getImplementationFormatter

public AbstractImplementationBlueprintFormatter getImplementationFormatter()

setImplementationFormatter

public void setImplementationFormatter(AbstractImplementationBlueprintFormatter implementationFormatter)


Copyright © 2010. All Rights Reserved.