Package javax.resource.spi

Examples of javax.resource.spi.ActivationSpec


    assertEquals(2, listeners.size());

    MessageListener listener = listeners.get(0);
    MessageListener listener1 = listeners.get(1);

    ActivationSpec as = listener.getActivation().createInstance();
    ActivationSpec as1 = listener1.getActivation().createInstance();
    assertNotNull(as);
    assertNotNull(as.getResourceAdapter());
    assertNotNull(as1);
    assertNotNull(as1.getResourceAdapter());

    AnnoActivationSpec tas = (AnnoActivationSpec) as;
    log.info("AS:" + tas + "//1//" + tas.getFirst() + "//2//"
        + tas.getSecond());
    assertEquals(new Character('C'), tas.getFirst());
View Full Code Here


    assertNotNull(listeners);
    assertEquals(1, listeners.size());

    MessageListener listener = listeners.get(0);

    ActivationSpec as = listener.getActivation().createInstance();
    assertNotNull(as);
    assertNotNull(as.getResourceAdapter());
  }
View Full Code Here

    assertNotNull(listeners);
    assertEquals(1, listeners.size());

    MessageListener listener = listeners.get(0);

    ActivationSpec as = listener.getActivation().createInstance();
    assertNotNull(as);
    assertNotNull(as.getResourceAdapter());
  }
View Full Code Here

                            + aClass.getClassLoader());
                    logger.log(Level.FINEST, "classloader parent = "
                            + aClass.getClassLoader().getParent());
                }

                ActivationSpec activationSpec =
                    (ActivationSpec) aClass.newInstance();
                Set props = RARUtils.getMergedActivationConfigProperties(getDescriptor());

                AccessController.doPrivileged
                    (new SetMethodAction(activationSpec, props));
                   
                activationSpec.setResourceAdapter(ra);
                //GF issue -3462 DIRECT mode MDB does not connect to remote broker when addresslist is overridden
                //Need to set properties after the setResourceAdapter method is called
                 AccessController.doPrivileged
                    (new SetMethodAction(activationSpec, props));

                /*
                  AccessController.doPrivileged(new PrivilegedAction() {
                  public java.lang.Object run() {
                  activationSpec.setResourceAdapter(ra);
                  return null;
                  }
                  });
                */
               
                boolean validate =
                    "true".equals(System.getProperty("validate.jms.ra"));
                if (validate) {
                    try {
                        activationSpec.validate();
                    } catch (Exception ex) {
                        logger.log(Level.SEVERE,
                                "endpointfactory.as_validate_Failed", ex);
                    }
                }
View Full Code Here

                String msg = "ActivationSpecClassName = " + activationSpecClassName;
                logger.log(Level.FINEST, msg);
            }

            try {
                ActivationSpec activationSpec = getActivationSpec(aira, activationSpecClassName);
                activationSpec.setResourceAdapter(ra);

                //at this stage, activation-spec is created, config properties merged with ejb-descriptor.
                //validate activation-spec now
                ConnectorRuntime runtime = ConnectorRuntime.getRuntime();
                runtime.getConnectorBeanValidator().validateJavaBean(activationSpec, resourceAdapterMid);
View Full Code Here

                    + aClass.getClassLoader());
            logger.log(Level.FINEST, "classloader parent = "
                    + aClass.getClassLoader().getParent());
        }

        ActivationSpec activationSpec =
                (ActivationSpec) aClass.newInstance();
        Set props = ConnectorsUtil.getMergedActivationConfigProperties(getDescriptor());

        AccessController.doPrivileged(new SetMethodAction(activationSpec, props));
        return activationSpec;
View Full Code Here

                            String msgListenerType = descriptor.getMessageListenerType();

                            // start resource adapter and get ActivationSpec class for
                            // the given message listener type from the ConnectorRuntime

                            ActivationSpec aspec = (ActivationSpec) (Class.forName(
                                    cr.getActivationSpecClass(raMid,
                                            msgListenerType), false,
                                    resourceAdapter.getClass().getClassLoader()).newInstance());
                            aspec.setResourceAdapter(resourceAdapter);

                            // Populate ActivationSpec class with ActivationConfig properties
                            SetMethodAction sma =
                                    new SetMethodAction(aspec, activationConfigProps);
                            sma.run();
View Full Code Here

                    deploymentInfo.getMdbInterface().getName() + " but this MDB container only supports " +
                    messageListenerInterface);
        }

        // create the activation spec
        ActivationSpec activationSpec = createActivationSpec(deploymentInfo);

        // create the message endpoint
        MdbInstanceFactory instanceFactory = new MdbInstanceFactory(deploymentInfo, transactionManager, securityService, instanceLimit);
        EndpointFactory endpointFactory = new EndpointFactory(activationSpec, this, deploymentInfo, instanceFactory);
View Full Code Here

            for (Map.Entry<String, String> entry : activationProperties.entrySet()) {
                objectRecipe.setMethodProperty(entry.getKey(), entry.getValue());
            }

            // create the activationSpec
            ActivationSpec activationSpec = (ActivationSpec) objectRecipe.create(activationSpecClass.getClassLoader());

            // verify all properties except "destination" and "destinationType" were consumed
            Set<String> unusedProperties = new TreeSet<String>(objectRecipe.getUnsetProperties().keySet());
            unusedProperties.remove("destination");
            unusedProperties.remove("destinationType");
            if (!unusedProperties.isEmpty()) {
                throw new IllegalArgumentException("No setter found for the activation spec properties: " + unusedProperties);
            }


            // validate the activation spec
            try {
                activationSpec.validate();
            } catch (UnsupportedOperationException uoe) {
                logger.info("ActivationSpec does not support validate. Implementation of validate is optional");
            }
           

            // set the resource adapter into the activation spec
            activationSpec.setResourceAdapter(resourceAdapter);

            return activationSpec;
        } catch (Exception e) {
            throw new OpenEJBException("Unable to create activation spec", e);
        }
View Full Code Here

                beanContext.getMdbInterface().getName() + " but this MDB container only supports " +
                messageListenerInterface);
        }

        // create the activation spec
        final ActivationSpec activationSpec = createActivationSpec(beanContext);

        if (inboundRecovery != null) {
            inboundRecovery.recover(resourceAdapter, activationSpec, containerID.toString());
        }
View Full Code Here

TOP

Related Classes of javax.resource.spi.ActivationSpec

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.