public class StateMachineProxyBuilder
extends java.lang.Object
StateMachine
.构造器和说明 |
---|
StateMachineProxyBuilder() |
限定符和类型 | 方法和说明 |
---|---|
java.lang.Object |
create(java.lang.Class<?>[] ifaces,
StateMachine sm)
Creates a proxy for the specified interfaces and which uses the specified
StateMachine . |
<T> T |
create(java.lang.Class<T> iface,
StateMachine sm)
Creates a proxy for the specified interface and which uses the specified
StateMachine . |
StateMachineProxyBuilder |
setClassLoader(java.lang.ClassLoader cl)
Sets the class loader to use for instantiating proxies.
|
StateMachineProxyBuilder |
setEventArgumentsInterceptor(EventArgumentsInterceptor interceptor)
Sets the
EventArgumentsInterceptor to be used. |
StateMachineProxyBuilder |
setEventFactory(EventFactory eventFactory)
Sets the
EventFactory to be used. |
StateMachineProxyBuilder |
setIgnoreStateContextLookupFailure(boolean b)
Sets whether the failure to lookup a
StateContext corresponding
to a method call on the proxy produced by this builder will raise an
exception or be silently ignored. |
StateMachineProxyBuilder |
setIgnoreUnhandledEvents(boolean b)
Sets whether events which have no handler in the current state will raise
an exception or be silently ignored.
|
StateMachineProxyBuilder |
setName(java.lang.String name)
Sets the name of the proxy created by this builder.
|
StateMachineProxyBuilder |
setStateContextLookup(StateContextLookup contextLookup)
Sets the
StateContextLookup to be used. |
public StateMachineProxyBuilder setName(java.lang.String name)
toString()
method. If not specified a default
auto generated name will be used.name
- the name.StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setStateContextLookup(StateContextLookup contextLookup)
StateContextLookup
to be used. The default is to use
a SingletonStateContextLookup
.contextLookup
- the StateContextLookup
to use.StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setEventFactory(EventFactory eventFactory)
EventFactory
to be used. The default is to use a
DefaultEventFactory
.eventFactory
- the EventFactory
to use.StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setEventArgumentsInterceptor(EventArgumentsInterceptor interceptor)
EventArgumentsInterceptor
to be used. By default no
EventArgumentsInterceptor
will be used.interceptor
- the EventArgumentsInterceptor
to use.StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setIgnoreUnhandledEvents(boolean b)
b
- true to ignore context lookup failures.StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setIgnoreStateContextLookupFailure(boolean b)
StateContext
corresponding
to a method call on the proxy produced by this builder will raise an
exception or be silently ignored. The default is to raise an exception.b
- true to ignore context lookup failures.StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setClassLoader(java.lang.ClassLoader cl)
ClassLoader
as returned by
Thread.getContextClassLoader()
.cl
- the class loaderStateMachineProxyBuilder
for method chaining.public <T> T create(java.lang.Class<T> iface, StateMachine sm)
StateMachine
.T
- The specified interface typeiface
- the interface the proxy will implement.sm
- the StateMachine
which will receive the events
generated by the method calls on the proxy.public java.lang.Object create(java.lang.Class<?>[] ifaces, StateMachine sm)
StateMachine
.ifaces
- the interfaces the proxy will implement.sm
- the StateMachine
which will receive the events
generated by the method calls on the proxy.