fr.gedeon.telnetservice
Class TelnetServiceExtensionAbstractImpl

java.lang.Object
  extended by fr.gedeon.telnetservice.TelnetServiceExtensionAbstractImpl
All Implemented Interfaces:
TelnetServiceExtension

public abstract class TelnetServiceExtensionAbstractImpl
extends Object
implements TelnetServiceExtension

Provides the implementation of the most basic API methods.

Author:
wgedeon@gmail.com

Constructor Summary
TelnetServiceExtensionAbstractImpl()
           
 
Method Summary
 Integer getActionDistributionPriority()
          The event distribution priority determines the order in which the listeners will receive an event, when there are more than one listener registered.
 ActionListener getActionListener()
          Serve an instance of the ActionListener implemented by this service extension.
Although it is recommended that the Action Listener implementation be stateless (with all state stored in the SessionState), it is left to the implementing party to decide whether to serve a singleton, an instance from a managed pool or a new instance at each call.
This method will be called once per session, at session construction time, following the order described in the package documentation.
 OutputFormatSpi[] getOutputFormats()
          Provide the OutpuFormats that are provided by this extension.
 PromptDecorator getPromptDecorator()
          Serve an instance of the ActionListener implemented by this service extension.
Although it is recommended that the Action Listener implementation be stateless (with all state stored in the SessionState), it is left to the implementing party to decide whether to serve a singleton, an instance from a managed pool or a new instance at each call.
This method will be called once per session, at session construction time, following the order described in the package documentation.
 Integer getPromptDecoratorPriority()
          The prompt decoration priority determines the order in which the decorators will be called to participate in the prompt construction, when there are more than one decorator registered.
The priority is from smallest to largest.
Note that depending on the return value of the calls to the PromptDecorator.decoratePrompt(SessionState, Prompt) method in a decorator will determine whether the next decorator in the list will be called at all -- some decorators with high priority may block lesser priority decorators from other subsequent prompt modification.
 boolean providesActionListener()
          This method will be checked before a call to TelnetServiceExtension.getActionListener() or TelnetServiceExtension.getActionDistributionPriority() is made.
 boolean providesOutputFormats()
          This method will be checked before calls to TelnetServiceExtension.getOutputFormats(), which will be called if the returned value is true
 boolean providesPromptDecorator()
          This method will be checked before a call to TelnetServiceExtension.getPromptDecorator() or TelnetServiceExtension.getPromptDecoratorPriority() is made.
 void setActionDistributionPriority(Integer actionDistributionPriority)
           
 void setPromptDecorationPriority(Integer promptDecoratorPriority)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.gedeon.telnetservice.TelnetServiceExtension
getDescription, getName
 

Constructor Detail

TelnetServiceExtensionAbstractImpl

public TelnetServiceExtensionAbstractImpl()
Method Detail

providesActionListener

public boolean providesActionListener()
Description copied from interface: TelnetServiceExtension
This method will be checked before a call to TelnetServiceExtension.getActionListener() or TelnetServiceExtension.getActionDistributionPriority() is made.

Specified by:
providesActionListener in interface TelnetServiceExtension
Returns:
false

setActionDistributionPriority

public void setActionDistributionPriority(Integer actionDistributionPriority)

getActionDistributionPriority

public Integer getActionDistributionPriority()
Description copied from interface: TelnetServiceExtension
The event distribution priority determines the order in which the listeners will receive an event, when there are more than one listener registered. The priority is from smallest to largest.
Note that depending on the return value for the handle* methods in the listener will determine whether the next listener in the list will receive the event at all -- some listeners with high priority may block the event from other subsequent listeners, this is especially the case for authentication check before access, etc.

Specified by:
getActionDistributionPriority in interface TelnetServiceExtension
Returns:
the event distribution priority, small integers to larger integers for higher priority to lower.

getActionListener

public ActionListener getActionListener()
                                 throws ActionListenerCreateException
Description copied from interface: TelnetServiceExtension
Serve an instance of the ActionListener implemented by this service extension.
Although it is recommended that the Action Listener implementation be stateless (with all state stored in the SessionState), it is left to the implementing party to decide whether to serve a singleton, an instance from a managed pool or a new instance at each call.
This method will be called once per session, at session construction time, following the order described in the package documentation.

Specified by:
getActionListener in interface TelnetServiceExtension
Returns:
null
Throws:
ActionListenerCreateException - if there are errors providing the listener instance.

providesPromptDecorator

public boolean providesPromptDecorator()
Description copied from interface: TelnetServiceExtension
This method will be checked before a call to TelnetServiceExtension.getPromptDecorator() or TelnetServiceExtension.getPromptDecoratorPriority() is made.

Specified by:
providesPromptDecorator in interface TelnetServiceExtension
Returns:
false

setPromptDecorationPriority

public void setPromptDecorationPriority(Integer promptDecoratorPriority)

getPromptDecoratorPriority

public Integer getPromptDecoratorPriority()
Description copied from interface: TelnetServiceExtension
The prompt decoration priority determines the order in which the decorators will be called to participate in the prompt construction, when there are more than one decorator registered.
The priority is from smallest to largest.
Note that depending on the return value of the calls to the PromptDecorator.decoratePrompt(SessionState, Prompt) method in a decorator will determine whether the next decorator in the list will be called at all -- some decorators with high priority may block lesser priority decorators from other subsequent prompt modification.

Specified by:
getPromptDecoratorPriority in interface TelnetServiceExtension
Returns:
the prompt decoration priority, small integers to larger integers for higher priority to lower.

getPromptDecorator

public PromptDecorator getPromptDecorator()
                                   throws PromptDecoratorCreateException
Description copied from interface: TelnetServiceExtension
Serve an instance of the ActionListener implemented by this service extension.
Although it is recommended that the Action Listener implementation be stateless (with all state stored in the SessionState), it is left to the implementing party to decide whether to serve a singleton, an instance from a managed pool or a new instance at each call.
This method will be called once per session, at session construction time, following the order described in the package documentation.

Specified by:
getPromptDecorator in interface TelnetServiceExtension
Returns:
null
Throws:
PromptDecoratorCreateException

providesOutputFormats

public boolean providesOutputFormats()
Description copied from interface: TelnetServiceExtension
This method will be checked before calls to TelnetServiceExtension.getOutputFormats(), which will be called if the returned value is true

Specified by:
providesOutputFormats in interface TelnetServiceExtension
Returns:
false

getOutputFormats

public OutputFormatSpi[] getOutputFormats()
Description copied from interface: TelnetServiceExtension
Provide the OutpuFormats that are provided by this extension. The returned items will be injected into the pool of output formats and ordered by their priority.

Specified by:
getOutputFormats in interface TelnetServiceExtension
Returns:
null


Copyright © 2008. All Rights Reserved.