Package rocket.generator.rebind.type

Examples of rocket.generator.rebind.type.Type


    context.branch();

    final String id = bean.getId();
    context.debug(id);

    final Type superType = this.getProxyFactoryBean();

    final NewConcreteType beanFactory = this.getBeanFactory();
    final NewNestedType proxyFactoryBean = beanFactory.newNestedType();
    proxyFactoryBean.setStatic(false);
    proxyFactoryBean.setNestedName(this.escapeBeanIdToBeClassNameSafe(id) + Constants.PROXY_FACTORY_BEAN_SUFFIX);
View Full Code Here


   * @return The new proxy
   */
  protected NewNestedType createProxy(final Bean bean) {
    Checker.notNull("parameter:bean", bean);

    final Type targetBeanType = bean.getType();
    final String id = bean.getId();

    // sub class the target...
    final NewConcreteType beanFactory = this.getBeanFactory();
    final NewNestedType proxy = beanFactory.newNestedType();
View Full Code Here

    body.setAspects(aspects);
    body.setBeanFactory(this.getBeanFactory());
    body.setMethod(newMethod);
    body.setTargetMethod(method);

    final Type methodInterceptor = this.getMethodInterceptor();
    final List<Type> methodInvocationParameterList = Arrays.asList(new Type[] { this.getMethodInvocation() });
    final Method invoke = methodInterceptor.getMethod(Constants.METHOD_INTERCEPTOR_INVOKE, methodInvocationParameterList);
    final MethodParameter target = (MethodParameter) invoke.getParameters().get(0);

    body.setTarget(target);
    newMethod.setBody(body);
  }
View Full Code Here

    newMethod.setNative(false);

    // add a new constructor...
    final MethodParameter targetBeanParameter = (MethodParameter) newMethod.getParameters().get(0);

    final Type proxy = bean.getProxy();
    final Constructor constructor = proxy.getConstructor(Collections.<Type>emptyList());

    final CreateProxyTemplatedFile body = new CreateProxyTemplatedFile();
    body.setProxyConstructor(constructor);
    body.setTargetBeanParameter(targetBeanParameter);
    body.setTargetBeanType(bean.getType());
View Full Code Here

   *            The id of a bean
   * @param className
   * @return The type
   */
  protected Type getInterfaceType(final String id, final String className) {
    final Type type = this.getGeneratorContext().findType(className);
    if (null == type) {
      throwBeanTypeNotFound(id, className);
    }
    if (false == type.isInterface() || type.isPrimitive()) {
      throwBeanTypeIsNotAnInterface(id, type);
    }
    return type;
  }
View Full Code Here

   *            The bean name
   * @param className
   * @return
   */
  protected Type getConcreteType(final String id, final String className) {
    final Type type = this.getGeneratorContext().findType(className);
    if (null == type) {
      throwBeanTypeNotFound(id, className);
    }
    if (type.isInterface() || type.isAbstract() || type.isPrimitive()) {
      throwBeanTypeIsNotConcrete(id, type);
    }
    return type;
  }
View Full Code Here

    if (false == serviceInterface.isInterface()) {
      this.throwServiceInterfaceIsNotAnInterface(serviceInterface);
    }

    // verify serviceInterface implements JsonRpcService
    final Type requiredServiceInterface = this.getRequiredInterface();
    if (false == serviceInterface.isAssignableTo(requiredServiceInterface)) {
      this.throwDoesntImplementRemoteJsonService(serviceInterface);
    }

    context.debug(serviceInterface.toString());
View Full Code Here

    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.info("Verifying async interface for : " + serviceInterface);

    try {
      final Type asyncServiceInterface = this.getAsyncServiceInterface(serviceInterface);

      if (false == asyncServiceInterface.isInterface()) {
        this.throwAsyncTypeIsNotAnInterface(asyncServiceInterface);
      }

      context.debug(asyncServiceInterface.toString());

    } catch (final TypeNotFoundException notFound) {
      this.throwUnableToFindAsyncType(serviceInterface);
    }
View Full Code Here

    Checker.notNull("parameter:serviceInterface", serviceInterface);
    Checker.notNull("parameter:client", client);

    this.getGeneratorContext().info("Implementing async service interface methods");

    final Type asyncServiceInterface = this.getAsyncServiceInterface(serviceInterface);

    final AllMethodsVisitor publicMethodFinder = new AllMethodsVisitor() {
      protected boolean visit(final Method method) {
        RpcClientGenerator.this.implementPublicMethod(method, serviceInterface, asyncServiceInterface, client);
        return false;
View Full Code Here

    this.getGeneratorContext().debug("Implementing method that sends method parameters as request parameters, method: " + method);

    final Iterator parameters = method.getParameters().iterator();
    while (parameters.hasNext()) {
      final MethodParameter parameter = (MethodParameter) parameters.next();
      final Type parameterType = parameter.getType();
      if (false == this.isSimpleType(parameterType)) {
        this.throwUnsupportedParameterTypeException(parameter);
      }
    }
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.type.Type

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.