Package org.cyclos.impl.system
Class ServiceInterceptorContextImpl
- java.lang.Object
-
- org.cyclos.impl.system.ServiceInterceptorContextImpl
-
- All Implemented Interfaces:
ServiceInterceptorContext
public class ServiceInterceptorContextImpl extends Object implements ServiceInterceptorContext
Implementation forServiceInterceptorContextsupporting propertyMissing methods for accessing attributes in Groovy.
-
-
Constructor Summary
Constructors Constructor Description ServiceInterceptorContextImpl(Object[] parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)Returns a contextual attribute by nameMap<String,Object>getAttributes()Returns the contextual attributesThrowablegetError()Returns the error for the service invocationObject[]getParameters()Returns the invocation parametersObjectgetResult()Returns service invocation resultbooleanisSkipInvocation()Returns whether the original service invocation should be skippedbooleanisSuccess()Returns whether no error is present in the current invocationObjectpropertyMissing(String name)Support method for Groovy scripts to handle propertiesvoidpropertyMissing(String name, Object value)Support method for Groovy scripts to handle propertiesvoidsetAttribute(String name, Object value)Sets a contextual attribute by namevoidsetAttributes(Map<String,Object> attributes)voidsetError(Throwable error)Sets the error for the service invocationvoidsetParameter(int index, Object value)Replaces an specific invocation parameter.voidsetParameters(Object[] newParams)Replaces all invocation parameters.voidsetResult(Object result)Sets the service invocation resultvoidsetSkipInvocation(boolean skipInvocation)Sets whether the original service invocation should be skippedvoidskipInvocation()Marks to skip the actual service invocation.voidskipInvocation(Object result)Equivallent toServiceInterceptorContext.skipInvocation()and thenServiceInterceptorContext.setResult(Object)
-
-
-
Constructor Detail
-
ServiceInterceptorContextImpl
public ServiceInterceptorContextImpl(Object[] parameters)
-
-
Method Detail
-
getAttribute
public Object getAttribute(String name)
Description copied from interface:ServiceInterceptorContextReturns a contextual attribute by name- Specified by:
getAttributein interfaceServiceInterceptorContext
-
getAttributes
public Map<String,Object> getAttributes()
Description copied from interface:ServiceInterceptorContextReturns the contextual attributes- Specified by:
getAttributesin interfaceServiceInterceptorContext
-
getError
public Throwable getError()
Description copied from interface:ServiceInterceptorContextReturns the error for the service invocation- Specified by:
getErrorin interfaceServiceInterceptorContext
-
getParameters
public Object[] getParameters()
Description copied from interface:ServiceInterceptorContextReturns the invocation parameters- Specified by:
getParametersin interfaceServiceInterceptorContext
-
getResult
public Object getResult()
Description copied from interface:ServiceInterceptorContextReturns service invocation result- Specified by:
getResultin interfaceServiceInterceptorContext
-
isSkipInvocation
public boolean isSkipInvocation()
Description copied from interface:ServiceInterceptorContextReturns whether the original service invocation should be skipped- Specified by:
isSkipInvocationin interfaceServiceInterceptorContext
-
isSuccess
public boolean isSuccess()
Description copied from interface:ServiceInterceptorContextReturns whether no error is present in the current invocation- Specified by:
isSuccessin interfaceServiceInterceptorContext
-
propertyMissing
public Object propertyMissing(String name)
Support method for Groovy scripts to handle properties
-
propertyMissing
public void propertyMissing(String name, Object value)
Support method for Groovy scripts to handle properties
-
setAttribute
public void setAttribute(String name, Object value)
Description copied from interface:ServiceInterceptorContextSets a contextual attribute by name- Specified by:
setAttributein interfaceServiceInterceptorContext
-
setError
public void setError(Throwable error)
Description copied from interface:ServiceInterceptorContextSets the error for the service invocation- Specified by:
setErrorin interfaceServiceInterceptorContext
-
setParameter
public void setParameter(int index, Object value)Description copied from interface:ServiceInterceptorContextReplaces an specific invocation parameter. The new parameter must match the corresponding service operation parameter type.- Specified by:
setParameterin interfaceServiceInterceptorContext
-
setParameters
public void setParameters(Object[] newParams)
Description copied from interface:ServiceInterceptorContextReplaces all invocation parameters. The new parameters size must be the same as the service operation parameters, and each parameter must match the type.- Specified by:
setParametersin interfaceServiceInterceptorContext
-
setResult
public void setResult(Object result)
Description copied from interface:ServiceInterceptorContextSets the service invocation result- Specified by:
setResultin interfaceServiceInterceptorContext
-
setSkipInvocation
public void setSkipInvocation(boolean skipInvocation)
Description copied from interface:ServiceInterceptorContextSets whether the original service invocation should be skipped- Specified by:
setSkipInvocationin interfaceServiceInterceptorContext
-
skipInvocation
public void skipInvocation()
Description copied from interface:ServiceInterceptorContextMarks to skip the actual service invocation. UseServiceInterceptorContext.setResult(Object)to set what will be returned by the method- Specified by:
skipInvocationin interfaceServiceInterceptorContext
-
skipInvocation
public void skipInvocation(Object result)
Description copied from interface:ServiceInterceptorContextEquivallent toServiceInterceptorContext.skipInvocation()and thenServiceInterceptorContext.setResult(Object)- Specified by:
skipInvocationin interfaceServiceInterceptorContext
-
-