fr.gedeon.telnetservice
Interface TelnetServiceExtension

All Known Implementing Classes:
TelnetServiceExtensionAbstractImpl

public interface TelnetServiceExtension

The ServiceExtension is the entry point for customizing the service.
A service extension has 2 purposes:

It is expected that the service extension name is unique, as it will be used when notifying about error situations and when logging activity. However, the uniqueness is not a must as the name will not be used for lookup.

Author:
wgedeon@gmail.com

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.
 String getDescription()
          An optional short description of this service extension.
 String getName()
          The name of this service extension.
 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 getActionListener() or getActionDistributionPriority() is made.
 boolean providesOutputFormats()
          This method will be checked before calls to getOutputFormats(), which will be called if the returned value is true
 boolean providesPromptDecorator()
          This method will be checked before a call to getPromptDecorator() or getPromptDecoratorPriority() is made.
 

Method Detail

getName

String getName()
The name of this service extension. Although not mandatory, it is recommended that this name be unique.

Returns:
the name of this service extension.

getDescription

String getDescription()
An optional short description of this service extension.

Returns:
a human readable description, or null if no description is available.

providesActionListener

boolean providesActionListener()
This method will be checked before a call to getActionListener() or getActionDistributionPriority() is made.

Returns:
true if this service extension provides an implementation to the ActionListener interface, false otherwise.

getActionListener

ActionListener getActionListener()
                                 throws ActionListenerCreateException
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.

Returns:
this extension's implementation of the action listener.
Throws:
ActionListenerCreateException - if there are errors providing the listener instance.

getActionDistributionPriority

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

Returns:
the event distribution priority, small integers to larger integers for higher priority to lower.

providesPromptDecorator

boolean providesPromptDecorator()
This method will be checked before a call to getPromptDecorator() or getPromptDecoratorPriority() is made.

Returns:
true if this service extension provides an implementation to the PromptDecorator interface, false otherwise.

getPromptDecorator

PromptDecorator getPromptDecorator()
                                   throws PromptDecoratorCreateException
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.

Returns:
this extension's implementation of the action listener.
Throws:
ActionListenerCreateException - if there are errors providing the listener instance.
PromptDecoratorCreateException

getPromptDecoratorPriority

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.

Returns:
the prompt decoration priority, small integers to larger integers for higher priority to lower.

providesOutputFormats

boolean providesOutputFormats()
This method will be checked before calls to getOutputFormats(), which will be called if the returned value is true

Returns:
true if this extension provides one or more OutputFormat implementations, false otherwise.

getOutputFormats

OutputFormatSpi[] getOutputFormats()
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.

Returns:
one or more provided OutputFormats


Copyright © 2008. All Rights Reserved.