Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server.util
Class ServiceTypeParser

java.lang.Object
  extended by org.jboss.errai.bus.server.util.ServiceParser
      extended by org.jboss.errai.bus.server.util.ServiceTypeParser

public class ServiceTypeParser
extends ServiceParser

A ServiceParser implementation for types annotated with Service.

Author:
Max Barkley

Field Summary
 
Fields inherited from class org.jboss.errai.bus.server.util.ServiceParser
commandPoints, local, svcName
 
Constructor Summary
ServiceTypeParser(Class<?> clazz)
          Create a ServiceParser for classes annotated with Service.
 
Method Summary
 MessageCallback getCallback(Object delegateInstance)
           
 Class<?> getDelegateClass()
           
 Class<?> getRemoteImplementation()
           
 boolean isCallback()
           
 String toString()
           
 
Methods inherited from class org.jboss.errai.bus.server.util.ServiceParser
getCommandPoints, getServiceName, hasCommandPoints, isLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceTypeParser

public ServiceTypeParser(Class<?> clazz)
                  throws NotAService
Create a ServiceParser for classes annotated with Service.

Parameters:
clazz - A class annotated with Service.
Throws:
NotAService - Thrown if clazz does not have a Service annotation.
Method Detail

getRemoteImplementation

public Class<?> getRemoteImplementation()
Returns:
The Remote interface associated with this type service or null if none exists.

getDelegateClass

public Class<?> getDelegateClass()
Specified by:
getDelegateClass in class ServiceParser
Returns:
The Class of the delegate instance for this service.

For a Service annotation on a type, this will be that type.
For a Service annotation on a method, this will be the enclosing type.

isCallback

public boolean isCallback()
Specified by:
isCallback in class ServiceParser
Returns:
True iff this is a type service with no command points, and this type is assignable to a MessageCallback.

toString

public String toString()
Overrides:
toString in class Object

getCallback

public MessageCallback getCallback(Object delegateInstance)
Specified by:
getCallback in class ServiceParser

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.