Class AbstractEmbeddedAspectran

All Implemented Interfaces:
CoreService, ServiceController, EmbeddedAspectran
Direct Known Subclasses:
DefaultEmbeddedAspectran

public abstract class AbstractEmbeddedAspectran extends AspectranCoreService implements EmbeddedAspectran
Provides an interface that can be used by embedding Aspectran in Java applications.
Since:
3.0.0
  • Constructor Details

    • AbstractEmbeddedAspectran

      public AbstractEmbeddedAspectran()
  • Method Details

    • isExposable

      public boolean isExposable(String transletName)
      Description copied from interface: EmbeddedAspectran
      Returns whether the translet can be exposed to the daemon service.
      Specified by:
      isExposable in interface EmbeddedAspectran
      Overrides:
      isExposable in class AbstractServiceController
      Parameters:
      transletName - the name of the translet to check
      Returns:
      true if the translet can be exposed; false otherwise
    • newSessionAdapter

      public SessionAdapter newSessionAdapter()
      Description copied from interface: EmbeddedAspectran
      Create and return a new session adapter from the embedded aspectran.
      Specified by:
      newSessionAdapter in interface EmbeddedAspectran
      Returns:
      the session adapter
    • createSessionManager

      protected void createSessionManager()
    • destroySessionManager

      protected void destroySessionManager()
    • getEnvironment

      public Environment getEnvironment()
      Description copied from interface: EmbeddedAspectran
      Gets the environment.
      Specified by:
      getEnvironment in interface EmbeddedAspectran
      Returns:
      the environment
    • getApplicationAdapter

      public ApplicationAdapter getApplicationAdapter()
      Description copied from interface: EmbeddedAspectran
      Gets the application adapter.
      Specified by:
      getApplicationAdapter in interface EmbeddedAspectran
      Returns:
      the application adapter
    • release

      public void release()
      Description copied from interface: EmbeddedAspectran
      Stop the service and release all allocated resources.
      Specified by:
      release in interface EmbeddedAspectran
    • getBean

      public <V> V getBean(String id)
      Description copied from interface: EmbeddedAspectran
      Return an instance of the bean that matches the given id.
      Specified by:
      getBean in interface EmbeddedAspectran
      Type Parameters:
      V - the type of bean object retrieved
      Parameters:
      id - the id of the bean to retrieve
      Returns:
      an instance of the bean
    • getBean

      public <V> V getBean(Class<V> type)
      Description copied from interface: EmbeddedAspectran
      Return an instance of the bean that matches the given object type.
      Specified by:
      getBean in interface EmbeddedAspectran
      Type Parameters:
      V - the type of bean object retrieved
      Parameters:
      type - the type the bean must match; can be an interface or superclass. null is disallowed.
      Returns:
      an instance of the bean
    • getBean

      public <V> V getBean(Class<V> type, String id)
      Description copied from interface: EmbeddedAspectran
      Return an instance of the bean that matches the given object type.
      Specified by:
      getBean in interface EmbeddedAspectran
      Type Parameters:
      V - the type of bean object retrieved
      Parameters:
      type - type the bean must match; can be an interface or superclass. null is allowed.
      id - the id of the bean to retrieve
      Returns:
      an instance of the bean
    • containsBean

      public boolean containsBean(String id)
      Description copied from interface: EmbeddedAspectran
      Return whether a bean with the specified id is present.
      Specified by:
      containsBean in interface EmbeddedAspectran
      Parameters:
      id - the id of the bean to query
      Returns:
      whether a bean with the specified id is present
    • containsBean

      public boolean containsBean(Class<?> type)
      Description copied from interface: EmbeddedAspectran
      Return whether a bean with the specified object type is present.
      Specified by:
      containsBean in interface EmbeddedAspectran
      Parameters:
      type - the object type of the bean to query
      Returns:
      whether a bean with the specified type is present
    • containsBean

      public boolean containsBean(Class<?> type, String id)
      Description copied from interface: EmbeddedAspectran
      Returns whether the bean corresponding to the specified object type and ID exists.
      Specified by:
      containsBean in interface EmbeddedAspectran
      Parameters:
      type - the object type of the bean to query
      id - the id of the bean to query
      Returns:
      whether a bean with the specified type is present
    • getMessage

      public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException
      Description copied from interface: EmbeddedAspectran
      Try to resolve the message. Treat as an error if the message can't be found.
      Specified by:
      getMessage in interface EmbeddedAspectran
      Parameters:
      code - the code to lookup up, such as 'calculator.noRateSet'
      args - Array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
      locale - the Locale in which to do the lookup
      Returns:
      the resolved message
      Throws:
      NoSuchMessageException - if the message wasn't found
      See Also:
    • getMessage

      public String getMessage(String code, Object[] args, String defaultMessage, Locale locale)
      Description copied from interface: EmbeddedAspectran
      Try to resolve the message. Return default message if no message was found.
      Specified by:
      getMessage in interface EmbeddedAspectran
      Parameters:
      code - the code to lookup up, such as 'calculator.noRateSet'. Users of this class are encouraged to base message names on the relevant fully qualified class name, thus avoiding conflict and ensuring maximum clarity.
      args - array of arguments that will be filled in for params within the message (params look like "{0}", "{1,date}", "{2,time}" within a message), or null if none.
      defaultMessage - String to return if the lookup fails
      locale - the Locale in which to do the lookup
      Returns:
      the resolved message if the lookup was successful; otherwise the default message passed as a parameter
      See Also: