Package javax.resource.spi

Examples of javax.resource.spi.ActivationSpec


        this.activationProps = componentDescription.getActivationProps();
    }

    @Override
    protected BasicComponent createComponent() {
        final ActivationSpec activationSpec = getEndpointDeployer().createActivationSpecs(resourceAdapterName, messageListenerInterface, activationProps, getDeploymentClassLoader());
        //final ActivationSpec activationSpec = null;
        final MessageDrivenComponent component = new MessageDrivenComponent(this, messageListenerInterface, activationSpec);
        final ResourceAdapter resourceAdapter = this.resourceAdapterInjectedValue.getValue();
        component.setResourceAdapter(resourceAdapter);
        try {
            activationSpec.setResourceAdapter(resourceAdapter);
        } catch (ResourceException e) {
            throw new RuntimeException(e);
        }
        return component;
    }
View Full Code Here


      ResourceAdapter ra = rar.get();

      if (ra == null)
         throw new NotFoundException(bundle.resourceAdapterNotAvailable());

      ActivationSpec instance = ActivationSpec.class.cast(clz.newInstance());
      instance.setResourceAdapter(ra);

      return instance;
   }
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 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

    // Stub code for ActivationSpec support that throws appropriate errors
    private void lookupActivationSpec() {       
        if ( jmsBinding.getActivationSpecName() != null )  {
          String createMode = jmsBinding.getActivationSpecCreate();
          if ( JMSBindingConstants.CREATE_ALWAYS.equals(createMode) ) {
            ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
            if ( spec != null ) {
              throw new JMSBindingException("ActivationSpec specifies create mode of \"always\" but resource already exists.");
            }
            throw new JMSBindingException("Can not create ActivationSpec");
          } else if ( JMSBindingConstants.CREATE_IF_NOT_EXIST.equals(createMode)) {
            ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
            if ( spec == null ) {
              throw new JMSBindingException("Can not create ActivationSpec");
            }
          } else if ( JMSBindingConstants.CREATE_NEVER.equals(createMode)) {
            ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
            if ( spec == null )
              throw new JMSBindingException("ActivationSpec specifies create mode of \"never\" but resource does not exist at jndiName " + jmsBinding.getActivationSpecName());
             
          }
                 
View Full Code Here

    // Stub code for ActivationSpec support that throws appropriate errors
    private void lookupActivationSpec() {       
        if ( jmsBinding.getActivationSpecName() != null )  {
          String createMode = jmsBinding.getActivationSpecCreate();
          if ( JMSBindingConstants.CREATE_ALWAYS.equals(createMode) ) {
            ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
            if ( spec != null ) {
              throw new JMSBindingException("ActivationSpec specifies create mode of \"always\" but resource already exists.");
            }
            throw new JMSBindingException("Can not create ActivationSpec");
          } else if ( JMSBindingConstants.CREATE_IF_NOT_EXIST.equals(createMode)) {
            ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
            if ( spec == null ) {
              throw new JMSBindingException("Can not create ActivationSpec");
            }
          } else if ( JMSBindingConstants.CREATE_NEVER.equals(createMode)) {
            ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
            if ( spec == null )
              throw new JMSBindingException("ActivationSpec specifies create mode of \"never\" but resource does not exist at jndiName " + jmsBinding.getActivationSpecName());
             
          } // end if
        } // end if
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.