Package com.caucho.remote.server

Examples of com.caucho.remote.server.ProtocolServletFactory


        else if (annType.isAnnotationPresent(ServiceType.class)) {
          ServiceType serviceType
            = (ServiceType) annType.getAnnotation(ServiceType.class);

          Class<?> factoryClass = serviceType.defaultFactory();
          ProtocolServletFactory factory
            = (ProtocolServletFactory) factoryClass.newInstance();

          factory.setServiceType(ann);
          factory.setAnnotated(annotated);

          Method urlPatternMethod = annType.getMethod("urlPattern");

          String urlPattern = (String) urlPatternMethod.invoke(ann);
     
View Full Code Here


  else if (annType.isAnnotationPresent(ServiceType.class)) {
    ServiceType serviceType
      = (ServiceType) annType.getAnnotation(ServiceType.class);

    Class factoryClass = serviceType.defaultFactory();
    ProtocolServletFactory factory
      = (ProtocolServletFactory) factoryClass.newInstance();

    factory.setServiceType(ann);
    factory.setAnnotated(annotated);

    Method urlPatternMethod = annType.getMethod("urlPattern");

    String urlPattern = (String) urlPatternMethod.invoke(ann);
     
    ServletMapping mapping = new ServletMapping();
    mapping.addURLPattern(urlPattern);
    mapping.setBean(bean);

    mapping.setProtocolFactory(factory);
 
    mapping.init();

    _webApp.addServletMapping(mapping);

    // event.veto();
  }
  else if (annType.isAnnotationPresent(ProxyType.class)) {
    ProxyType proxyType
      = (ProxyType) annType.getAnnotation(ProxyType.class);

    Class factoryClass = proxyType.defaultFactory();
    ProtocolProxyFactory proxyFactory
      = (ProtocolProxyFactory) factoryClass.newInstance();

    proxyFactory.setProxyType(ann);
    proxyFactory.setAnnotated(annotated);

    Object proxy = proxyFactory.createProxy((Class) annotated.getBaseType());

    AnnotatedTypeImpl annotatedType
      = new AnnotatedTypeImpl((Class) annotated.getBaseType());

    annotatedType.addAnnotation(EnhancedLiteral.ANNOTATION);

    BeanFactory factory
      = _beanManager.createBeanFactory(annotatedType);

    /*
    factory.name(bean.getName());

    for (Type type : bean.getTypes()) {
      factory.type(type);
    }

    */
    for (Annotation binding : annotated.getAnnotations()) {
      Class bindingType = binding.annotationType();
     
      if (bindingType.isAnnotationPresent(Qualifier.class))
        factory.binding(binding);
    }

    _beanManager.addBean(factory.singleton(proxy));

    event.veto();
  }
      }
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.caucho.remote.server.ProtocolServletFactory

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.