Package com.caucho.jca.ra

Examples of com.caucho.jca.ra.ResourceArchive


  }


  public void setResourceAdapter(String name)
  {
    ResourceArchive ra = ResourceArchiveManager.findResourceArchive(name);

    if (ra == null)
      throw new ConfigException(L.l("'{0}' is an unknown resource-adapter"));
  }
View Full Code Here


    if (_messagingType != null) {
    }
    else if (_activationSpec != null) {
      String specName = _activationSpec.getClass().getName();

      ResourceArchive ra
        = ResourceArchiveManager.findResourceArchive(specName);

      if (ra == null) {
        throw new ConfigException(L.l("'{0}' is an unknown activation-spec.  Make sure the JCA adapter is deployed in a .rar file",
                                      specName));
      }

      try {
        _activationSpec.validate();
      } catch (Exception e) {
        throw error(e);
      }

      MessageListenerConfig listener = ra.getMessageListener(specName);

      _messagingType = listener.getMessageListenerType();
    }
    else if (MessageListener.class.isAssignableFrom(getEJBClass())) {
      _messagingType = MessageListener.class;
View Full Code Here

    if (_activationSpec == null)
      throw new ConfigException(L.l("ActivationSpec is required for ActivationSpecServer"));

    String specType = _activationSpec.getClass().getName();

    ResourceArchive raCfg = ResourceArchiveManager.findResourceArchive(specType);

    if (raCfg == null)
      throw error(L.l("'{0}' is an unknown activation-spec.  Make sure the .rar file for the driver is properly installed.",
                      specType));

    Class<?> raClass = raCfg.getResourceAdapterClass();

    if (raClass == null)
      throw error(L.l("resource-adapter class does not exist for activation-spec '{0}'.  Make sure the .rar file for the driver is properly installed.",
                      _activationSpec.getClass().getName()));
View Full Code Here

  /**
   * Creates a resource adapter program based on the class.
   */
  public ResourceAdapterAssociationProgram(Class cl)
  {
    ResourceArchive ra
      = ResourceArchiveManager.findResourceArchive(cl.getName());

    if (ra == null) {
      throw new ConfigException(L.l("'{0}' does not have a defined resource-adapter.  Check the rar or META-INF/resin-ra.xml files",
                                    cl.getName()));
    }

    InjectManager webBeans = InjectManager.create();
   
    _raController
      = webBeans.getReference(ResourceAdapterController.class,
                              Names.create(ra.getResourceAdapterClass().getName()));
   
    if (_raController == null) {
      throw new ConfigException(L.l("'{0}' does not have a configured resource-adapter for '{1}'.",
                                    ra.getResourceAdapterClass().getName(),
                                    cl.getName()));
    }

  }
View Full Code Here

 
  private <T> void addProducer()
  {
    Class<T> type = (Class<T>) getClassType();

    ResourceArchive ra
      = ResourceArchiveManager.findResourceArchive(type.getName());

    ResourceAdapterController controller
      = new ResourceAdapterController((Bean<ResourceAdapter>) getComponent(), ra);
View Full Code Here

      cm.setName(getName());

    cm.setMaxConnections(_maxConnections);
    cm.setMaxActiveTime(_maxActiveTime);

    ResourceArchive rar = null;

    if (rar != null) {
      String trans = rar.getTransactionSupport();

      if (trans == null) { // guess XA
        cm.setXATransaction(true);
        cm.setLocalTransaction(true);
      }
View Full Code Here

  private ResourceAdapter findResourceAdapter(Class cl)
  {
    if (_ra != null)
      return _ra;

    ResourceArchive ra
      = ResourceArchiveManager.findResourceArchive(cl.getName());

    if (ra == null) {
      throw new ConfigException(L.l("'{0}' does not have a defined resource-adapter.  Either define it in a &lt;resource-adapter> property or check the rar or META-INF/resin-ra.xml files",
                                    cl.getName()));
    }

    InjectManager cdiManager = InjectManager.create();
    String raName = ra.getResourceAdapterClass().getSimpleName();
   
    raName = Character.toLowerCase(raName.charAt(0)) + raName.substring(1);

    Instance<ResourceAdapter> instance
      = _raInstance.select(Names.create(raName));
View Full Code Here

  /**
   * Creates a resource adapter program based on the class.
   */
  public ResourceAdapterAssociationProgram(Class cl)
  {
    ResourceArchive ra
      = ResourceArchiveManager.findResourceArchive(cl.getName());

    if (ra == null) {
      throw new ConfigException(L.l("'{0}' does not have a defined resource-adapter.  Check the rar or META-INF/resin-ra.xml files",
            cl.getName()));
    }

    InjectManager webBeans = InjectManager.create();
   
    _raController
      = webBeans.getReference(ResourceAdapterController.class,
            Names.create(ra.getResourceAdapterClass().getName()));
   
    if (_raController == null) {
      throw new ConfigException(L.l("'{0}' does not have a configured resource-adapter for '{1}'.",
            ra.getResourceAdapterClass().getName(),
            cl.getName()));
    }

  }
View Full Code Here

 
  private <T> void addProducer()
  {
    Class<T> type = (Class<T>) getClassType();

    ResourceArchive ra
      = ResourceArchiveManager.findResourceArchive(type.getName());

    ResourceAdapterController controller
      = new ResourceAdapterController((Bean<ResourceAdapter>) getComponent(), ra);
View Full Code Here

      cm.setName(getName());

    cm.setMaxConnections(_maxConnections);
    cm.setMaxActiveTime(_maxActiveTime);

    ResourceArchive rar = null;

    if (rar != null) {
      String trans = rar.getTransactionSupport();

      if (trans == null) { // guess XA
        cm.setXATransaction(true);
        cm.setLocalTransaction(true);
      }
View Full Code Here

TOP

Related Classes of com.caucho.jca.ra.ResourceArchive

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.