Package com.caucho.config.gen

Examples of com.caucho.config.gen.ApiClass


                                           ApiMethod sourceMethod,
                                           ApiClass sourceClass)
    throws ConfigException
  {
    ApiMethod method = null;
    ApiClass beanClass = getEJBClassWrapper();

    method = getMethod(beanClass, methodName, param);

    if (method == null && sourceMethod != null) {
      throw error(L.l("{0}: '{1}' expected to match {2}.{3}",
                      beanClass.getName(),
                      getFullMethodName(methodName, param),
                      sourceMethod.getDeclaringClass().getSimpleName(),
                      getFullMethodName(sourceMethod)));
    }
    else if (method == null) {
      throw error(L.l("{0}: '{1}' expected",
                      beanClass.getName(),
                      getFullMethodName(methodName, param)));
    }
    /*
      else if (Modifier.isAbstract(method.getModifiers()) &&
      getBeanManagedPersistence()) {
      throw error(L.l("{0}: '{1}' must not be abstract",
      beanClass.getName(),
      getFullMethodName(methodName, param)));
      }
    */
    else if (! method.isPublic()) {
      throw error(L.l("{0}: '{1}' must be public",
                      beanClass.getName(),
                      getFullMethodName(methodName, param)));
    }

    if (method.isStatic()) {
      throw error(L.l("{0}: '{1}' must not be static",
                      beanClass.getName(),
                      getFullMethodName(methodName, param)));
    }

    if (method.isFinal()) {
      throw error(L.l("{0}: '{1}' must not be final.",
                      beanClass.getName(),
                      getFullMethodName(methodName, param),
                      beanClass.getName()));
    }

    return method;
  }
View Full Code Here


      throw error(L.l("{0}: expected '{1}'",
                      _ejbClass.getName(),
                      getFullMethodName(methodName, param)));
    }

    ApiClass declaringClass = method.getDeclaringClass();

    if (method.isAbstract()) {
      if (method.getDeclaringClass().getName().equals("javax.ejb.EntityBean"))
        throw error(L.l("{0}: '{1}' must not be abstract.  Entity beans must implement the methods in EntityBean.",
                        _ejbClass.getName(),
View Full Code Here

        for (int i = 0; i < values.length; i++) {
          if (values[i] instanceof Class) {
            Class localClass = (Class) values[i];

            setLocalWrapper(new ApiClass(localClass));
          }
          else if (values[i] instanceof Class) {
            setLocal((Class) values[i]);
          }
        }
      }

      Remote remote = type.getAnnotation(Remote.class);
      if (remote != null) {
        Object []values = remote.value();

        for (int i = 0; i < values.length; i++) {
          if (values[i] instanceof Class) {
            Class remoteClass = (Class) values[i];

            setRemoteWrapper(new ApiClass(remoteClass));
          }
          else if (values[i] instanceof Class) {
            setRemote((Class) values[i]);
          }
        }

        // ejb/0f08: single interface
        if (values.length == 0) {
    // XXX: getGenericInterfaces
          Class []ifs = type.getJavaClass().getInterfaces();

          if (ifs.length == 1)
            setRemoteWrapper(new ApiClass(ifs[0]));
        }
      }

      TransactionAttribute xa = type.getAnnotation(TransactionAttribute.class);
      if (xa != null) {
View Full Code Here

   * Sets the ejb implementation class.
   */
  public void setEJBClass(Class ejbClass)
    throws ConfigException
  {
    setEJBClassWrapper(new ApiClass(ejbClass, _annotatedType));
  }
View Full Code Here

   * Sets the remote home interface class.
   */
  public void setHome(Class homeClass)
    throws ConfigException
  {
    ApiClass home = new ApiClass(homeClass);
   
    setRemoteHomeWrapper(home);
  }
View Full Code Here

   * Sets the ejb remote interface
   */
  public void setRemote(Class remote)
    throws ConfigException
  {
    setRemoteWrapper(new ApiClass(remote));
  }
View Full Code Here

  /**
   * Adds a remote interface class
   */
  public void addBusinessRemote(Class remoteClass)
  {
    ApiClass remote = new ApiClass(remoteClass);
   
    if (! remote.isPublic())
      throw error(L.l("'{0}' must be public.  <business-remote> interfaces must be public.", remote.getName()));

    if (! remote.isInterface())
      throw error(L.l("'{0}' must be an interface. <business-remote> interfaces must be interfaces.", remote.getName()));

    if (! _remoteList.contains(remote)) {
      _remoteList.add(remote);
    }
  }
View Full Code Here

  {
    if (_remoteList.size() < 1)
      return null;

    try {
      ApiClass remote = _remoteList.get(0);

      return Class.forName(remote.getName(), false, getClassLoader());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

   * Sets the ejb local home interface
   */
  public void setLocalHome(Class localHomeClass)
    throws ConfigException
  {
    ApiClass localHome = new ApiClass(localHomeClass);
   
    setLocalHomeWrapper(localHome);
  }
View Full Code Here

   * Sets the ejb local interface
   */
  public void setLocal(Class local)
    throws ConfigException
  {
    setLocalWrapper(new ApiClass(local));
  }
View Full Code Here

TOP

Related Classes of com.caucho.config.gen.ApiClass

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.