Package javax.resource

Examples of javax.resource.ResourceException


  @Override
  public abstract BasicConnection getConnection() throws ResourceException;
 
  @Override
  public BasicConnection getConnection(ConnectionSpec arg0) throws ResourceException {
    throw new ResourceException("This operation not supported"); //$NON-NLS-1$;
  }
View Full Code Here


    throw new ResourceException("This operation not supported"); //$NON-NLS-1$;
  }

  @Override
  public ResourceAdapterMetaData getMetaData() throws ResourceException {
    throw new ResourceException("This operation not supported"); //$NON-NLS-1$;
  }
View Full Code Here

    throw new ResourceException("This operation not supported"); //$NON-NLS-1$;
  }

  @Override
  public RecordFactory getRecordFactory() throws ResourceException {
    throw new ResourceException("This operation not supported"); //$NON-NLS-1$
  }
View Full Code Here

public abstract class BasicConnection implements Connection {

  @Override
  public Interaction createInteraction() throws ResourceException {
    throw new ResourceException("This operation not supported"); //$NON-NLS-1$
  }
View Full Code Here

    return null;
  }

  @Override
  public ConnectionMetaData getMetaData() throws ResourceException {
    throw new ResourceException("This operation not supported"); //$NON-NLS-1$
  }
View Full Code Here

    throw new ResourceException("This operation not supported"); //$NON-NLS-1$
  }

  @Override
  public ResultSetInfo getResultSetInfo() throws ResourceException {
    throw new ResourceException("This operation not supported"); //$NON-NLS-1$
  }
View Full Code Here

    }
    else {
      if (! (cxRequest instanceof ConnectionRequest)) {
          if (out != null)
              out.print("Provided ConnectionRequestInfo instance is not a JORAM object.");
        throw new ResourceException("Provided ConnectionRequestInfo instance "
                                    + "is not a JORAM object.");
      }

      userName = ((ConnectionRequest) cxRequest).getUserName();
      password = ((ConnectionRequest) cxRequest).getPassword();
      identityClass = ((ConnectionRequest) cxRequest).getIdentityClass();
    }

    XAConnection cnx = null;

    if (collocated) {
        hostName = "localhost";
        serverPort = -1;
    }

    try {

        if (isHa) {
          if (collocated) {
            if (ra.haURL != null) {
              if (cxRequest instanceof QueueConnectionRequest) {
                XAQueueConnectionFactory factory = XAQueueHATcpConnectionFactory.create(ra.haURL);
                setParameters(factory);
                ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                cnx = factory.createXAQueueConnection(userName, password);
              } else {
                XAConnectionFactory factory = XAHATcpConnectionFactory.create(ra.haURL);
                setParameters(factory);
                ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                cnx = factory.createXAConnection(userName, password);
              }
            } else {         
              if (cxRequest instanceof QueueConnectionRequest) {
                XAQueueConnectionFactory factory = XAQueueHALocalConnectionFactory.create();
                setParameters(factory);
                ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                cnx = factory.createXAQueueConnection(userName, password);
              } else {
                XAConnectionFactory factory = XAHALocalConnectionFactory.create();
                setParameters(factory);
                cnx = factory.createXAConnection(userName, password);
              }
            }
          } else {
            String urlHa = "hajoram://" + hostName + ":" + serverPort;
            if (cxRequest instanceof QueueConnectionRequest) {
              XAQueueConnectionFactory factory = XAQueueHATcpConnectionFactory.create(urlHa);
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXAQueueConnection(userName, password);
            } else {
              XAConnectionFactory factory = XAHATcpConnectionFactory.create(urlHa);
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXAConnection(userName, password);
            }
          }
        } else {
            if (collocated) {
                if (cxRequest instanceof QueueConnectionRequest) {
                    XAQueueConnectionFactory factory = XAQueueLocalConnectionFactory.create();
                    setParameters(factory);
                    ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                    cnx = factory.createXAQueueConnection(userName, password);
                } else {
                    XAConnectionFactory factory = XALocalConnectionFactory.create();
                    setParameters(factory);
                    ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                    cnx = factory.createXAConnection(userName, password);
                }
            } else {
                if (cxRequest instanceof QueueConnectionRequest) {
                    XAQueueConnectionFactory factory = XAQueueTcpConnectionFactory.create(hostName, serverPort);
                    setParameters(factory);
                    ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                    cnx = factory.createXAQueueConnection(userName, password);
                } else {
                    XAConnectionFactory factory = XATcpConnectionFactory.create(hostName, serverPort);
                    setParameters(factory);
                    ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
                    cnx = factory.createXAConnection(userName, password);
                }
            }
        }

        if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
            AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " createManagedConnection cnx = " + cnx);

    } catch (IllegalStateException exc) {
        if (out != null)
            out.print("Could not access the JORAM server: " + exc);
      throw new CommException("Could not access the JORAM server: " + exc);
    } catch (JMSSecurityException exc) {
        if (out != null)
            out.print("Invalid user identification: " + exc);
      throw new SecurityException("Invalid user identification: " + exc);
    } catch (JMSException exc) {
        if (out != null)
            out.print("Failed connecting process: " + exc);
      throw new ResourceException("Failed connecting process: " + exc);
    }

    ManagedConnection managedCx = new ManagedConnectionImpl(ra,
                                                            cnx,
                                                            hostName,
View Full Code Here

      userName = this.userName;
    else {
      if (! (cxRequest instanceof ConnectionRequest)) {
          if (out != null)
              out.print("Provided ConnectionRequestInfo instance is not a JORAM object.");
        throw new ResourceException("Provided ConnectionRequestInfo instance "
                                    + "is not a JORAM object.");
      }

      userName = ((ConnectionRequest) cxRequest).getUserName();
View Full Code Here

    }

    if (! (connection instanceof OutboundConnection)) {
        if (out != null)
            out.print("The provided connection handle is not a JORAM handle.");
      throw new ResourceException("The provided connection handle is not "
                                  + "a JORAM handle.");
    }

    OutboundConnection newConn = (OutboundConnection) connection;
    newConn.managedCx = this;
View Full Code Here

    }
    else {
      if (! (cxRequest instanceof ConnectionRequest)) {
          if (out != null)
              out.print("Provided ConnectionRequestInfo instance is not a JORAM object.");
        throw new ResourceException("Provided ConnectionRequestInfo instance "
                                    + "is not a JORAM object.");
      }

      userName = ((ConnectionRequest) cxRequest).getUserName();
      password = ((ConnectionRequest) cxRequest).getPassword();
      identityClass = ((ConnectionRequest) cxRequest).getIdentityClass();
    }

    XAConnection cnx = null;

    if (collocated) {
        hostName = "localhost";
        serverPort = -1;
    }

    try {
      if (isHa) {
        if (collocated) {
          if (ra.haURL != null) {
            if (cxRequest instanceof TopicConnectionRequest) {
              XATopicConnectionFactory factory = XATopicHATcpConnectionFactory.create(ra.haURL);
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXATopicConnection(userName, password);
            } else {
              XAConnectionFactory factory = XAHATcpConnectionFactory.create(ra.haURL);
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXAConnection(userName, password);
            }
          } else {
            if (cxRequest instanceof TopicConnectionRequest) {
              XATopicConnectionFactory factory = XATopicHALocalConnectionFactory.create();
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXATopicConnection(userName, password);
            } else {
              XAConnectionFactory factory = XAHALocalConnectionFactory.create();
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXAConnection(userName, password);
            }
          }
        } else {
          String urlHa = "hajoram://" + hostName + ":" + serverPort;
          if (cxRequest instanceof TopicConnectionRequest) {
            XATopicConnectionFactory factory = XATopicHATcpConnectionFactory.create(urlHa);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXATopicConnection(userName, password);
          } else {
            XAConnectionFactory factory = XAHATcpConnectionFactory.create(urlHa);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXAConnection(userName, password);
          }
        }
      } else {
        if (collocated) {
          if (cxRequest instanceof TopicConnectionRequest) {
            XATopicConnectionFactory factory = XATopicLocalConnectionFactory.create();
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXATopicConnection(userName, password);
          } else {
            XAConnectionFactory factory = XALocalConnectionFactory.create();
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXAConnection(userName, password);
          }
        } else {
          if (cxRequest instanceof TopicConnectionRequest) {
            XATopicConnectionFactory factory = XATopicTcpConnectionFactory.create(hostName, serverPort);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXATopicConnection(userName, password);
          } else {
            XAConnectionFactory factory = XATcpConnectionFactory.create(hostName, serverPort);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXAConnection(userName, password);
          }
        }
      }
      if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
        AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG,
                                      this + " createManagedConnection cnx = " + cnx);
    } catch (IllegalStateException exc) {
        if (out != null)
            out.print("Could not access the JORAM server: " + exc);
      throw new CommException("Could not access the JORAM server: " + exc);
    } catch (JMSSecurityException exc) {
        if (out != null)
            out.print("Invalid user identification: " + exc);
      throw new SecurityException("Invalid user identification: " + exc);
    } catch (JMSException exc) {
        if (out != null)
            out.print("Failed connecting process: " + exc);
      throw new ResourceException("Failed connecting process: " + exc);
    }

    ManagedConnection managedCx = new ManagedConnectionImpl(ra,
                                                            cnx,
                                                            hostName,
View Full Code Here

TOP

Related Classes of javax.resource.ResourceException

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.