Package com.google.gwt.requestfactory.shared

Examples of com.google.gwt.requestfactory.shared.Service


  /**
   * Examine a RequestContext subtype to populate a ContextMethod.
   */
  private void buildContextMethod(ContextMethod.Builder contextBuilder,
      JClassType contextType) throws UnableToCompleteException {
    Service serviceAnnotation = contextType.getAnnotation(Service.class);
    ServiceName serviceNameAnnotation = contextType.getAnnotation(ServiceName.class);
    if (serviceAnnotation == null && serviceNameAnnotation == null) {
      poison("RequestContext subtype %s is missing a @%s annotation",
          contextType.getQualifiedSourceName(), Service.class.getSimpleName());
      return;
View Full Code Here


      Method contextMethod, Method domainMethod) {
    Class<? extends ServiceLocator> locatorType;

    // Look at the RequestContext
    Class<?> requestContextClass = contextMethod.getDeclaringClass();
    Service l = requestContextClass.getAnnotation(Service.class);
    ServiceName ln = requestContextClass.getAnnotation(ServiceName.class);
    if (l != null && !ServiceLocator.class.equals(l.locator())) {
      locatorType = l.locator();
    } else if (ln != null && ln.locator().length() > 0) {
      try {
        locatorType = Class.forName(ln.locator(), false,
            requestContextClass.getClassLoader()).asSubclass(
            ServiceLocator.class);
View Full Code Here

  @Override
  public Method resolveDomainMethod(Method requestContextMethod) {
    Class<?> enclosing = requestContextMethod.getDeclaringClass();

    Class<?> searchIn = null;
    Service s = enclosing.getAnnotation(Service.class);
    if (s != null) {
      searchIn = s.value();
    }
    ServiceName sn = enclosing.getAnnotation(ServiceName.class);
    if (sn != null) {
      searchIn = forName(sn.value());
    }
View Full Code Here

  /**
   * Examine a RequestContext subtype to populate a ContextMethod.
   */
  private void buildContextMethod(ContextMethod.Builder contextBuilder,
      JClassType contextType) throws UnableToCompleteException {
    Service serviceAnnotation = contextType.getAnnotation(Service.class);
    ServiceName serviceNameAnnotation = contextType.getAnnotation(ServiceName.class);
    JsonRpcService jsonRpcAnnotation = contextType.getAnnotation(JsonRpcService.class);
    if (serviceAnnotation == null && serviceNameAnnotation == null
        && jsonRpcAnnotation == null) {
      poison("RequestContext subtype %s is missing a @%s or @%s annotation",
View Full Code Here

      Method domainMethod) {
    Class<? extends ServiceLocator> locatorType;

    // Look at the RequestContext
    Class<?> requestContextClass = contextMethod.getDeclaringClass();
    Service l = requestContextClass.getAnnotation(Service.class);
    ServiceName ln = requestContextClass.getAnnotation(ServiceName.class);
    if (l != null && !ServiceLocator.class.equals(l.locator())) {
      locatorType = l.locator();
    } else if (ln != null && ln.locator().length() > 0) {
      try {
        locatorType =
            Class.forName(ln.locator(), false, getTop().getDomainClassLoader()).asSubclass(
                ServiceLocator.class);
View Full Code Here

  }

  @Override
  public Class<?> resolveServiceClass(Class<? extends RequestContext> requestContextClass) {
    Class<?> searchIn = null;
    Service s = requestContextClass.getAnnotation(Service.class);
    // TODO Handle case when both annotations are present
    if (s != null) {
      searchIn = s.value();
    }
    ServiceName sn = requestContextClass.getAnnotation(ServiceName.class);
    if (sn != null) {
      searchIn = forName(sn.value());
    }
View Full Code Here

      // Do not invoke static initializer before checking if this class can be
      // legally invoked
      Class<?> requestClass = Class.forName(reqClassName, false,
          this.getClass().getClassLoader());
      securityProvider.checkClass(requestClass);
      Service domainClassAnnotation = requestClass.getAnnotation(Service.class);
      if (domainClassAnnotation != null) {
        Class<?> domainClass = domainClassAnnotation.value();
        Method requestMethod = findMethod(requestClass, domainMethodName);
        Method domainMethod = findMethod(domainClass, domainMethodName);
        boolean isInstance = (requestMethod.getAnnotation(Instance.class) != null);
        if (requestMethod != null && domainMethod != null) {
          if (isInstance == Modifier.isStatic(domainMethod.getModifiers())) {
View Full Code Here

* annotations.
*/
public class DefaultSecurityProvider implements RequestSecurityProvider {

  public void checkClass(Class<?> clazz) throws SecurityException {
    Service service = clazz.getAnnotation(Service.class);
    if (service == null) {
      throw new SecurityException(
          "Class " + clazz.getName() + " does not have a @Service annotation.");
    }
    try {
      Class.forName(service.value().getCanonicalName());
    } catch (ClassNotFoundException e) {
      throw new SecurityException(
          "Class " + service.value() + " from @Service annotation on " + clazz
              + " cannot be loaded.");
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.requestfactory.shared.Service

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.