Package org.jrest4guice.rest.annotations

Examples of org.jrest4guice.rest.annotations.RESTful


    this.client = new JRestClient();
  }

  public <T> T createRemoteService(Class<T> serviceClazz) {
    if (!serviceClazz.isAnnotationPresent(RESTful.class)) {
      RESTful annotation = (RESTful) serviceClazz
          .getAnnotation(RESTful.class);
      if (!annotation.remoteable())
        throw new RuntimeException(serviceClazz.getName() + "不支持远程调用!");
    }

    this.methods = ClassUtils.getSortedMethodList(serviceClazz);
View Full Code Here


  public Object intercept(Object instance, Method method, Object[] args,
      MethodProxy proxy) throws Throwable {
    Object result = null;

    Class<?> clazz = method.getDeclaringClass();
    RESTful annotation = (RESTful) clazz.getAnnotation(RESTful.class);
    String name = annotation.name();
    if (name == null || name.trim().equals(""))
      name = clazz.getName();

    int index = -1;
    for (Method m : methods) {
View Full Code Here

        String[] uris;
        String mimiType, name;
        String[] mimiTypes;
        Field[] fields;
        RemoteReference remoteServiceAnnotation;
        RESTful resourceAnnotation;
        Class<RemoteReference> remoteServiceClass = RemoteReference.class;
        Class type;
        for (Class clazz : classes) {
          if (clazz.isAnnotationPresent(RESTful.class)) {
            resourceAnnotation = (RESTful)clazz.getAnnotation(RESTful.class);
            if(resourceAnnotation.remoteable()){
              name = resourceAnnotation.name();
              if (name == null || name.trim().equals(""))
                name = clazz.getName();
 
              jRestContext.addRemoteService(name, clazz);
            }
View Full Code Here

TOP

Related Classes of org.jrest4guice.rest.annotations.RESTful

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.