Package com.aspectran.embed.service
Class AspectranEmbeddedService
- java.lang.Object
-
- com.aspectran.core.service.AbstractServiceController
-
- com.aspectran.core.service.AbstractCoreService
-
- com.aspectran.core.service.AspectranCoreService
-
- com.aspectran.embed.service.AspectranEmbeddedService
-
- All Implemented Interfaces:
CoreService,ServiceController,EmbeddedAspectran
public class AspectranEmbeddedService 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 AspectranEmbeddedService()
-
Method Summary
All Methods Static 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.protected static AspectranEmbeddedServicecreate(AspectranConfig aspectranConfig)Returns a new instance ofAspectranEmbeddedService.SessionAdapternewSessionAdapter()Creates a new session adapter for the embedded aspectran and returns.voidrelease()Stop the service and release all allocated resources.java.lang.Stringtemplate(java.lang.String templateId)Evaluates the template without any provided variables.java.lang.Stringtemplate(java.lang.String templateId, ParameterMap parameterMap)Evaluates the template with a set of parameters.java.lang.Stringtemplate(java.lang.String templateId, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Evaluates the template with a set of parameters and attributes.java.lang.Stringtemplate(java.lang.String templateId, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Evaluate the template with a set of parameters.Translettranslate(java.lang.String name)Executes the translet.Translettranslate(java.lang.String name, ParameterMap parameterMap)Executes the translet.Translettranslate(java.lang.String name, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet.Translettranslate(java.lang.String name, MethodType method)Executes the translet.Translettranslate(java.lang.String name, MethodType method, ParameterMap parameterMap)Executes the translet.Translettranslate(java.lang.String name, MethodType method, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet.Translettranslate(java.lang.String name, MethodType method, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet.Translettranslate(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Executes the translet.-
Methods inherited from class com.aspectran.core.service.AspectranCoreService
doPause, doPause, doRestart, doResume, doStart, doStop
-
Methods inherited from class com.aspectran.core.service.AbstractCoreService
createSchedulerService, destroyActivityContext, determineBasePath, getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getServiceController, isDerived, isExposable, isHardReload, isLateStart, joinDerivedService, loadActivityContext, prepare, setActivityContext, setBasePath, setExposals
-
Methods inherited from class com.aspectran.core.service.AbstractServiceController
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, 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:EmbeddedAspectranCreates a new session adapter for the embedded aspectran and returns.- Specified by:
newSessionAdapterin interfaceEmbeddedAspectran- Returns:
- the session adapter
-
translate
public Translet translate(java.lang.String name)
Executes the translet.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet name- Returns:
- the
Transletobject
-
translate
public Translet translate(java.lang.String name, ParameterMap parameterMap)
Executes the translet.- 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)
Executes the translet.- 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)
Executes the translet.- 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)
Executes the translet.- 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)
Executes the translet.- 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)
Executes the translet.- 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)
Executes the translet.- Specified by:
translatein interfaceEmbeddedAspectran- Parameters:
name- the translet namemethod- the request methodparameterMap- the parameter mapattributeMap- the attribute map- Returns:
- the
Transletobject
-
template
public java.lang.String template(java.lang.String templateId)
Evaluates the template without any provided variables.- Specified by:
templatein interfaceEmbeddedAspectran- Parameters:
templateId- the template id- Returns:
- the output string of the template
-
template
public java.lang.String template(java.lang.String templateId, ParameterMap parameterMap)Evaluates the template with a set of parameters.- Specified by:
templatein interfaceEmbeddedAspectran- Parameters:
templateId- the template idparameterMap- the parameter map- Returns:
- the output string of the template
-
template
public java.lang.String template(java.lang.String templateId, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Evaluate the template with a set of parameters.- Specified by:
templatein interfaceEmbeddedAspectran- Parameters:
templateId- the template idattributeMap- the attribute map- Returns:
- the output string of the template
-
template
public java.lang.String template(java.lang.String templateId, ParameterMap parameterMap, java.util.Map<java.lang.String,java.lang.Object> attributeMap)Evaluates the template with a set of parameters and attributes.- Specified by:
templatein 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
-
create
protected static AspectranEmbeddedService create(AspectranConfig aspectranConfig)
Returns a new instance ofAspectranEmbeddedService.- Parameters:
aspectranConfig- the parameters for aspectran configuration- Returns:
- the instance of
AspectranEmbeddedService
-
-