com.ail.core.command
Class Command

java.lang.Object
  extended by com.ail.core.Type
      extended by com.ail.core.command.AbstractCommand
          extended by com.ail.core.command.Command
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AcceptQuotationCommand, AddPolicyNumberCommand, AddQuoteNumberCommand, AssessPaymentOptionsCommand, AssessPolicyRiskCommand, AssessRiskCommand, AssessSectionRiskCommand, CalculateBrokerageCommand, CalculateCommissionCommand, CalculateManagementChargeCommand, CalculatePolicyBrokerageCommand, CalculatePolicyCommissionCommand, CalculatePolicyMgmtChgCommand, CalculatePolicyTaxCommand, CalculatePremiumCommand, CalculateTaxCommand, CancelEntryCommand, CatalogCarCommand, CloseSessionCommand, CollectPremiumCommand, CreateCommand, DeleteCommand, DeployCarCommand, EnforceComplianceCommand, EnforcePolicyComplianceCommand, FetchDocumentCommand, FromXMLCommand, GenerateDocumentCommand, GenerateDocumentCommand, GenerateDocumentCommand, GeneratePolicyNumberRuleCommand, GenerateQuoteNumberRuleCommand, GetClassListCommand, GetCommandScriptCommand, GetConfigurationCommand, GetNamespacesCommand, GetNamespacesHistoryCommand, ListProductsCommand, LoadCommand, LoggerCommand, MakeARecoveryCommand, MakeEntryCommand, MergeDataCommand, NewProductTypeCommand, NotifyPartyCommand, OpenSessionCommand, PackageCarCommand, ProduceDocumentationCommand, PutOnRiskCommand, QueryCommand, RefreshAssessmentSheetsCommand, RegisterProductCommand, RemoveProductCommand, RenderDocumentCommand, ResetAllProductsCommand, ResetProductCommand, SetCommandScriptCommand, SetConfigurationCommand, StyleDocumentCommand, TestCommand, ToXMLCommand, UpdateCommand, UpdateProductCommand, ValidatorCommand

public abstract class Command
extends AbstractCommand

Version:
$Revision: 1.2 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ail.core.Type
jXPathContext, NOT_PERSISTED
 
Constructor Summary
Command()
           
 
Method Summary
 java.lang.Object clone()
          Clone this command.
 Accessor getAccessor()
          Get the accessor used by this command.
 CoreUser getCallersCore()
          Get hold of the caller's core.
 Configuration getConfiguration()
          Get the service's configuration.
 Version getVersion()
          Get the service's version information.
 void invoke()
          Invoke the serivce itself.
 void setAccessor(Accessor accessor)
          Set the accessor property.
 void setCallersCore(CoreUser callersCore)
          Set the caller's core.
 void setConfiguration(Configuration config)
          Set the service's configuration.
 void setService(Accessor accessor)
          Set the accessor property.
 
Methods inherited from class com.ail.core.command.AbstractCommand
getArgs, setArgs
 
Methods inherited from class com.ail.core.Type
addAttribute, deleteLock, deleteSerialVersion, fetchJXPathContext, getAttribute, getAttribute, getAttributeCount, getForeignSystemId, getLock, getSerialVersion, getSystemId, hasLock, hasSerialVersion, hasSystemId, isPersisted, markAsNotPersisted, mergeWithDataFrom, removeAttribute, removeAttribute, setAttribute, setForeignSystemId, setLock, setSerialVersion, setSystemId, xpathGet, xpathGet, xpathIterate, xpathSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command()
Method Detail

getCallersCore

public CoreUser getCallersCore()
Get hold of the caller's core. This will be needed if the service needs to see the world (configuration) from the caller's perspective.

Returns:
Caller's core instance.

setCallersCore

public void setCallersCore(CoreUser callersCore)
Set the caller's core. This is called when the command is invoked.

Parameters:
callersCore -
See Also:
getCallersCore()

getAccessor

public Accessor getAccessor()
Get the accessor used by this command. The accessor is the means by which the command communicates with the service.

Returns:
Accessor

setAccessor

public void setAccessor(Accessor accessor)
Set the accessor property.

Parameters:
accessor - The accessor to use.
See Also:
getAccessor()

setService

public void setService(Accessor accessor)
Set the accessor property. This does exactly the same thing as setAccessor, but exposing it as setService makes the configuration process more intuative.

i.e. rather than:

  <command name="mycommand"...>
    <parameter name="accessor">myService</parameter>
  </command>
you can use:
  <command name="mycommand"...>
    <parameter name="service">myService</parameter>
  </command>

Parameters:
accessor - The accessor to use.
See Also:
getAccessor()

invoke

public void invoke()
            throws BaseException
Invoke the serivce itself.

Specified by:
invoke in class AbstractCommand
Throws:
BaseException - Thrown by the service.

getConfiguration

public Configuration getConfiguration()
Get the service's configuration. This simply deligates to the service's getConfiguration method.

Specified by:
getConfiguration in class AbstractCommand
Returns:
The service's configuration.

setConfiguration

public void setConfiguration(Configuration config)
Set the service's configuration. This method simply deligates to the service's setConfiguration method.

Specified by:
setConfiguration in class AbstractCommand
Parameters:
config - The configuration to pass to the service.
See Also:
getConfiguration()

getVersion

public Version getVersion()
Get the service's version information.

Specified by:
getVersion in class AbstractCommand
Returns:
The service's version details

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone this command.

Overrides:
clone in class Type
Returns:
The cloned command object.
Throws:
java.lang.CloneNotSupportedException - If the command (or one of its properties) cannot be 'deep' cloned.