Package org.jboss.errai.bus.server.io

Examples of org.jboss.errai.bus.server.io.MethodEndpointCallback


            }

            Annotation annotation = m.getAnnotation(Service.class);
            String svcName = ((Service) annotation).value().equals("") ? m.getName() : ((Service) annotation).value();
            if (parmTypes.length == 1 && !Message.class.isAssignableFrom(parmTypes[0])) {
              context.getBus().subscribe(svcName, new MethodEndpointCallback(inst, m));
            }
            else {
              Class parmClass = parmTypes[0];
              if (!parmClass.isAnnotationPresent(ExposeEntity.class)) {
                log.warn("method service-endpoint accepts a type which is not exposed to the Errai serializer: "
                    + m.getDeclaringClass().getName() + "#" + m.getName());
              }

              context.getBus().subscribe(svcName, new MethodEndpointDynamicParmCallback(inst, m, parms, parmTypes));
            }

          }
          else {
            int i = 0;
            for (Annotation[] annotations : m.getParameterAnnotations()) {
              Class parmType = parmTypes[i++];

              for (Annotation annotation : annotations) {
                if (annotation instanceof Service) {
                  if (!Message.class.isAssignableFrom(parmType))
                    throw new ErraiBootstrapFailure("attempt to declare service handler on illegal type: " + parmType.getName());

                  if (parmTypes.length != 1)
                    throw new ErraiBootstrapFailure("wrong number of method arguments for service endpoint: " + m.getName() + ": " + parmTypes.length);

                  String svcName = ((Service) annotation).value().equals("") ? m.getName() : ((Service) annotation).value();

                  context.getBus().subscribe(svcName, new MethodEndpointCallback(inst, m));
                }
              }
            }
          }
        }
View Full Code Here


                        Annotation annotation = m.getAnnotation(Service.class);

                        String svcName = ((Service) annotation).value().equals("") ? m.getName() : ((Service) annotation).value();

                        context.getBus().subscribe(svcName, new MethodEndpointCallback(inst, m));
                    } else {
                        int i = 0;
                        for (Annotation[] annotations : m.getParameterAnnotations()) {
                            Class parmType = parmTypes[i++];

                            for (Annotation annotation : annotations) {
                                if (annotation instanceof Service) {
                                    if (!Message.class.isAssignableFrom(parmType))
                                        throw new ErraiBootstrapFailure("attempt to declare service handler on illegal type: " + parmType.getName());

                                    if (parmTypes.length != 1)
                                        throw new ErraiBootstrapFailure("wrong number of method arguments for service endpoint: " + m.getName() + ": " + parmTypes.length);

                                    String svcName = ((Service) annotation).value().equals("") ? m.getName() : ((Service) annotation).value();

                                    context.getBus().subscribe(svcName, new MethodEndpointCallback(inst, m));
                                }
                            }
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.jboss.errai.bus.server.io.MethodEndpointCallback

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.