Package org.jboss.seam

Examples of org.jboss.seam.Component


      }
    }

    private boolean isPerNestedConversation(String name)
    {
        Component component = Component.forName(name);
        return (component != null) && component.isPerNestedConversation();
    }
View Full Code Here


  {
    super.setElement(element);

    String beanType = element.attributeValue("type");

    Component component = Component.forName(beanType);

    if (component != null)
    {
      value = component.newInstance();
    }
    else
    {
      try {
        value = Reflections.classForName(beanType).newInstance();
View Full Code Here

              an API method in CGLIB that can be used instead */
    if (cls.getName().contains("EnhancerByCGLIB"))
      cls = cls.getSuperclass();
   
    String componentName = Seam.getComponentName(cls);
    Component component = componentName != null ? Component.forName(componentName) : null;
   
    if (component != null)
       cls = component.getBeanClass();      

    if (componentName != null)
      out.write(componentName.getBytes());
    else
      out.write(cls.getName().getBytes());
View Full Code Here

         String methodName, Class[] paramTypes, Object[] args)
         throws InvocationTargetException, IllegalAccessException,
         SecurityException {

      // Find the component we're calling
      Component component = Component.forName(serviceIntfName);

      if (component == null)
         throw new RuntimeException("No such component: " + serviceIntfName);

      Object instance = getServiceComponent(serviceIntfName);
      Class clz = null;

      if (component.getType().isSessionBean()
            && component.getBusinessInterfaces().size() > 0) {
         for (Class c : component.getBusinessInterfaces()) {
            if (c.isAnnotationPresent(EJB.LOCAL)) {
               clz = c;
               break;
            }
         }

         if (clz == null)
            throw new RuntimeException(
                  String
                        .format(
                              "Type cannot be determined for component [%s]. Please ensure that it has a local interface.",
                              component));
      }

      if (clz == null)
         clz = component.getBeanClass();

      Method method = getMethod(serviceIntfName, methodName, clz, paramTypes);

      Object result = method.invoke(instance, args);
      return new ReturnedObject(method.getReturnType(), result);
View Full Code Here

 
  private void processInvocation()
     throws Exception
  {    
     // Find the component we're calling
     Component component = Component.forName(componentName);

     if (component == null)
       throw new RuntimeException("No such component: " + componentName);

     // Create an instance of the component
     Object instance = Component.getInstance(componentName, true);
    
     if (instance == null)
     {
        throw new RuntimeException(String.format(
              "Could not create instance of component %s", componentName));
     }

     Class type = null;

     if (component.getType().isSessionBean() &&
         component.getBusinessInterfaces().size() > 0)
     {
       for (Class c : component.getBusinessInterfaces())
       {
         if (c.isAnnotationPresent(EJB.LOCAL))
         {
           type = c;
           break;
         }
       }

       if (type == null)
         throw new RuntimeException(String.format(
         "Type cannot be determined for component [%s]. Please ensure that it has a local interface.", component));
     }

     if (type == null)
       type = component.getBeanClass();

     // Find the method according to the method name and the parameter classes
     Method m = findMethod(methodName, type);
     if (m == null)
       throw new RuntimeException("No compatible method found.");
View Full Code Here

         installComponent(appContext, ResourceLoader.class);
      }

      protected void installComponent(Context appContext, Class clazz)
      {
         appContext.set( Seam.getComponentName(clazz) + ".component", new Component(clazz) );
      }
View Full Code Here

               {
                  log.debug("redeploying components");
                  Seam.clearComponentNameCache();
                  for ( String name: init.getHotDeployableComponents() )
                  {
                     Component component = Component.forName(name);
                     if (component!=null)
                     {
                        ScopeType scope = component.getScope();
                        if ( scope!=ScopeType.STATELESS && scope.isContextActive() )
                        {
                           scope.getContext().remove(name);
                        }
                        init.removeObserverMethods(component);
View Full Code Here

   {
      String name = descriptor.getName();
      String componentName = name + COMPONENT_SUFFIX;
      try
      {
         Component component = new Component(
               descriptor.getComponentClass(),
               name,
               descriptor.getScope(),
               descriptor.isStartup(),
               descriptor.getStartupDependencies(),
               descriptor.getJndiName()
            );
         context.set(componentName, component);
         if ( hotDeploymentStrategy != null && hotDeploymentStrategy.isEnabled() && hotDeploymentStrategy.isFromHotDeployClassLoader( descriptor.getComponentClass() ) )
         {
            Init.instance().addHotDeployableComponent( component.getName() );
         }
      }
      catch (Throwable e)
      {
         throw new RuntimeException("Could not create Component: " + name, e);
View Full Code Here

   }

   private void processInvocation() throws Exception
   {
      // Find the component we're calling
      Component component = Component.forName(componentName);

      if (component == null)
      {
         throw new RuntimeException("No such component: " + componentName);
      }

      // Create an instance of the component
      Object instance = Component.getInstance(componentName, true);

      if (instance == null)
      {
         throw new RuntimeException(String.format(
               "Could not create instance of component %s", componentName));
      }

      Class type = null;

      if (component.getType().isSessionBean()
            && component.getBusinessInterfaces().size() > 0)
      {
         for (Class c : component.getBusinessInterfaces())
         {
            if (c.isAnnotationPresent(EJB.LOCAL))
            {
               type = c;
               break;
            }
         }

         if (type == null)
         {
            throw new RuntimeException(String.format(
               "Type cannot be determined for component [%s]. Please ensure that it has a local interface.",
               component));
         }
      }

      if (type == null)
      {
         type = component.getBeanClass();
      }

      // Find the method according to the method name and the parameter classes
      Method m = findMethod(methodName, type);
      if (m == null)
View Full Code Here

      log.info("redeploying");
      ServletLifecycle.beginReinitialization(request);
      Init init = Init.instance();
      for ( String name: init.getHotDeployableComponents() )
      {
         Component component = Component.forName(name);
         if (component!=null)
         {
            ScopeType scope = component.getScope();
            if ( scope!=ScopeType.STATELESS && scope.isContextActive() )
            {
               scope.getContext().remove(name);
            }
            init.removeObserverMethods(component);
View Full Code Here

TOP

Related Classes of org.jboss.seam.Component

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.