Package com.aspectran.embed.service
Class DefaultEmbeddedAspectran
- java.lang.Object
-
- com.aspectran.core.service.AbstractServiceController
-
- com.aspectran.core.service.AbstractCoreService
-
- com.aspectran.core.service.AspectranCoreService
-
- com.aspectran.embed.service.DefaultEmbeddedAspectran
-
- All Implemented Interfaces:
CoreService,ServiceController,EmbeddedAspectran
public class DefaultEmbeddedAspectran extends AspectranCoreService implements EmbeddedAspectran
Provides an interface that can be used by embedding Aspectran in Java applications.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description DefaultEmbeddedAspectran()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterContextLoaded()This method is executed immediately after the ActivityContext is loaded.voidbeforeContextDestroy()This method executed just before the ActivityContext is destroyed.SessionAdapternewSessionAdapter()Create and return a new session adapter from the embedded aspectran.voidrelease()Stop the service and release all allocated resources.java.lang.Stringrender(java.lang.String templateId)Renders the template without the supplied variables.java.lang.Stringrender(java.lang.String templateId, ParameterMap parameterMap)Renders the template with the given parameters.java.lang.Stringrender(java.lang.String templateId, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Renders the template with the given parameters and attributes.java.lang.Stringrender(java.lang.String templateId, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Renders the template with the given attributes.Translettranslate(java.lang.String name)Executes the translet.Translettranslate(java.lang.String name, ParameterMap parameterMap)Executes the translet with the given parameters.Translettranslate(java.lang.String name, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet with the given parameters and attributes.Translettranslate(java.lang.String name, MethodType method)Executes the translet without the supplied variables.Translettranslate(java.lang.String name, MethodType method, ParameterMap parameterMap)Executes the translet with the given parameters.Translettranslate(java.lang.String name, MethodType method, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet with the given parameters and attributes.Translettranslate(java.lang.String name, MethodType method, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet with the given attributes.Translettranslate(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet with the given parameters.-
Methods inherited from class com.aspectran.core.service.AspectranCoreService
doPause, doPause, doResume, doStart, doStop
-
Methods inherited from class com.aspectran.core.service.AbstractCoreService
destroyActivityContext, determineBasePath, getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getDefaultActivity, getSchedulerService, getServiceController, isDerived, isExposable, isHardReload, isLateStart, joinDerivedService, loadActivityContext, prepare, setActivityContext, setBasePath, setExposals
-
Methods inherited from class com.aspectran.core.service.AbstractServiceController
clearDerivedService, getLock, getServiceName, isActive, isBusy, joinDerivedService, pause, pause, restart, restart, resume, setServiceStateListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.aspectran.core.service.CoreService
getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getDefaultActivity, getServiceController, isHardReload, isLateStart, joinDerivedService
-
-
-
-
Method Detail
-
afterContextLoaded
public void afterContextLoaded() throws java.lang.ExceptionDescription copied from class:AspectranCoreServiceThis method is executed immediately after the ActivityContext is loaded.- Overrides:
afterContextLoadedin classAspectranCoreService- Throws:
java.lang.Exception- if an error occurs
-
beforeContextDestroy
public void beforeContextDestroy()
Description copied from class:AspectranCoreServiceThis method executed just before the ActivityContext is destroyed.- Overrides:
beforeContextDestroyin classAspectranCoreService
-
newSessionAdapter
public SessionAdapter newSessionAdapter()
Description copied from interface:EmbeddedAspectranCreate and return a new session adapter from the embedded aspectran.- Specified by:
newSessionAdapterin interfaceEmbeddedAspectran- Returns:
- the session adapter
-
translate
public Translet translate(java.lang.String name)
Description copied from interface:EmbeddedAspectranExecutes the translet.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet name- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, ParameterMap parameterMap)
Description copied from interface:EmbeddedAspectranExecutes the translet with the given parameters.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet nameparameterMap- the parameter map- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Description copied from interface:EmbeddedAspectranExecutes the translet with the given parameters and attributes.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet nameparameterMap- the parameter mapattributeMap- the attribute map- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Description copied from interface:EmbeddedAspectranExecutes the translet with the given parameters.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet nameattributeMap- the attribute map- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, MethodType method)
Description copied from interface:EmbeddedAspectranExecutes the translet without the supplied variables.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet namemethod- the request method- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, MethodType method, ParameterMap parameterMap)
Description copied from interface:EmbeddedAspectranExecutes the translet with the given parameters.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet namemethod- the request methodparameterMap- the parameter map- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, MethodType method, java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Description copied from interface:EmbeddedAspectranExecutes the translet with the given attributes.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet namemethod- the request methodattributeMap- the attribute map- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, MethodType method, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Description copied from interface:EmbeddedAspectranExecutes the translet with the given parameters and attributes.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet namemethod- the request methodparameterMap- the parameter mapattributeMap- the attribute map- Returns:
- the
Transletobject
-
render
public java.lang.String render(java.lang.String templateId)
Description copied from interface:EmbeddedAspectranRenders the template without the supplied variables.- Specified by:
renderin interfaceEmbeddedAspectran- Parameters:
templateId- the template id- Returns:
- the output string of the template
-
render
public java.lang.String render(java.lang.String templateId, ParameterMap parameterMap)Description copied from interface:EmbeddedAspectranRenders the template with the given parameters.- Specified by:
renderin interfaceEmbeddedAspectran- Parameters:
templateId- the template idparameterMap- the parameter map- Returns:
- the output string of the template
-
render
public java.lang.String render(java.lang.String templateId, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Description copied from interface:EmbeddedAspectranRenders the template with the given attributes.- Specified by:
renderin interfaceEmbeddedAspectran- Parameters:
templateId- the template idattributeMap- the attribute map- Returns:
- the output string of the template
-
render
public java.lang.String render(java.lang.String templateId, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Description copied from interface:EmbeddedAspectranRenders the template with the given parameters and attributes.- Specified by:
renderin interfaceEmbeddedAspectran- Parameters:
templateId- the template idparameterMap- the parameter mapattributeMap- the attribute map- Returns:
- the output string of the template
-
release
public void release()
Description copied from interface:EmbeddedAspectranStop the service and release all allocated resources.- Specified by:
releasein interfaceEmbeddedAspectran
-
-