public class ClientAnnotationProcessor extends AnnotationProcessor
Processes annotations in client-side service objects.
Service objects must be annotated with Service
at class level to be processed by this processor,
for example:
@Service public class MyService { @Listener(Channel.META_CONNECT) public void metaConnect(Message message) { // Do something } }
The processor is used in this way:
ClientSession bayeux = ...; ClientAnnotationProcessor processor = ClientAnnotationProcessor.get(bayeux); MyService s = new MyService(); processor.process(s);
Constructor and Description |
---|
ClientAnnotationProcessor(ClientSession clientSession) |
ClientAnnotationProcessor(ClientSession clientSession,
Object... injectables) |
Modifier and Type | Method and Description |
---|---|
boolean |
deprocess(Object bean)
Performs the opposite processing done by
process(Object) on callbacks methods
annotated with Listener and Subscription , and on lifecycle methods annotated
with PreDestroy . |
boolean |
deprocessCallbacks(Object bean)
Performs the opposite processing done by
processCallbacks(Object)
on callback methods annotated with Listener and Subscription . |
boolean |
process(Object bean)
Processes dependencies annotated with
Session , callbacks
annotated with Listener and Subscription and lifecycle
methods annotated with PostConstruct . |
boolean |
processPostConstruct(Object bean)
Processes lifecycle methods annotated with
PostConstruct . |
boolean |
processPreDestroy(Object bean)
Processes lifecycle methods annotated with
PreDestroy . |
callPublic, checkMethodsPublic, checkSignaturesMatch, findAnnotatedMethods, getField, invokePrivate, invokePublic, processInjectable, processInjectables, processParameters, setField
public ClientAnnotationProcessor(ClientSession clientSession)
public ClientAnnotationProcessor(ClientSession clientSession, Object... injectables)
public boolean process(Object bean)
Session
, callbacks
annotated with Listener
and Subscription
and lifecycle
methods annotated with PostConstruct
.bean
- the annotated service instancepublic boolean processPostConstruct(Object bean)
PostConstruct
.processPostConstruct
in class AnnotationProcessor
bean
- the annotated service instancepublic boolean deprocess(Object bean)
process(Object)
on callbacks methods
annotated with Listener
and Subscription
, and on lifecycle methods annotated
with PreDestroy
.bean
- the annotated service instanceprocess(Object)
public boolean deprocessCallbacks(Object bean)
processCallbacks(Object)
on callback methods annotated with Listener
and Subscription
.bean
- the annotated service instancepublic boolean processPreDestroy(Object bean)
PreDestroy
.processPreDestroy
in class AnnotationProcessor
bean
- the annotated service instanceCopyright © 2008–2024 The CometD Project. All rights reserved.