Package javax.resource.spi

Examples of javax.resource.spi.ManagedConnection


                                           service.getServiceName(),
                                           portName);
        cri.setAddress("http://localhost:" + PORT + "/SoapContext/SoapPort");
        ManagedConnectionFactory managedFactory = new ManagedConnectionFactoryImpl();
        Subject subject = new Subject();
        ManagedConnection mc = managedFactory.createManagedConnection(subject, cri);       
        Object o = mc.getConnection(subject, cri);
       
        // test for the Object hash()
        try {
            o.hashCode();
            o.toString();
View Full Code Here


        CXFConnectionRequestInfo requestInfo = new CXFConnectionRequestInfo();
        requestInfo.setInterface(Greeter.class);
        requestInfo.setAddress("http://localhost:" + PORT + "/SoapContext/SoapPort");
       
        ManagedConnectionFactory factory = new ManagedConnectionFactoryImpl();
        ManagedConnection mc = factory.createManagedConnection(null, requestInfo);
        Object client = mc.getConnection(null, requestInfo);
       
        verifyResult(client);
    }
View Full Code Here

     * @see javax.resource.spi.ManagedConnectionFactory#matchManagedConnections
     */
    public ManagedConnection matchManagedConnections
        (Set connectionSet, Subject subject, ConnectionRequestInfo requestInfo)
        throws ResourceException {
        ManagedConnection res = null;
        if (connectionSet.size() > 0) {
            res = (ManagedConnection)connectionSet.iterator().next();
        }
        return res;
    }
View Full Code Here

     * Comment copied from interface or superclass.
     */
    public Object allocateConnection
        (ManagedConnectionFactory mcf, ConnectionRequestInfo ci)
        throws ResourceException {
        ManagedConnection mc = mcf.createManagedConnection(null, ci);
        return mc.getConnection(null, ci);
    }
View Full Code Here

     */
    public Object allocateConnection(ManagedConnectionFactory connectionFactory, ConnectionRequestInfo info)
        throws ResourceException
    {
        Subject subject = null;
        ManagedConnection connection = connectionFactory.createManagedConnection(subject, info);
        connection.addConnectionEventListener(this);
        return connection.getConnection(subject, info);
    }
View Full Code Here

    /**
     * @see javax.resource.spi.ConnectionManager#allocateConnection(javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ConnectionRequestInfo)
     */
    public Object allocateConnection(ManagedConnectionFactory connectionFactory, ConnectionRequestInfo info) throws ResourceException {
        Subject subject = null;
        ManagedConnection connection = connectionFactory.createManagedConnection(subject, info);
        connection.addConnectionEventListener(this);
        return connection.getConnection(subject, info);
    }
View Full Code Here

    }

    public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
        if (reauthentication) {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
                if (managedConnections.contains(managedConnection)) {
                    return managedConnection;
                }
            }
        } else {
            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
//                return managedConnection;
                if (managedConnections.contains(managedConnection)) {
                    MockManagedConnection mockManagedConnection = (MockManagedConnection) managedConnection;
                    if ((subject == null ? mockManagedConnection.getSubject() == null : subject.equals(mockManagedConnection.getSubject())
                            && (cxRequestInfo == null ? mockManagedConnection.getConnectionRequestInfo() == null : cxRequestInfo.equals(mockManagedConnection.getConnectionRequestInfo())))) {
View Full Code Here

     *
     * @param l
     */
    public void addConnectionEventListener(ConnectionEventListener l ) {
        for (Iterator iter = connections.iterator(); iter.hasNext();) {
            ManagedConnection c = (ManagedConnection) iter.next();
            c.addConnectionEventListener(l);
        }
        listners.add(l);
    }
View Full Code Here

    /**
     * @see javax.resource.spi.ConnectionManager#allocateConnection(javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ConnectionRequestInfo)
     */
    public Object allocateConnection(ManagedConnectionFactory connectionFactory, ConnectionRequestInfo info) throws ResourceException {
        Subject subject = null;
        ManagedConnection connection = connectionFactory.createManagedConnection(subject, info);
        connection.addConnectionEventListener(this);
        for (Iterator iter = listners.iterator(); iter.hasNext();) {
            ConnectionEventListener l = (ConnectionEventListener) iter.next();
            connection.addConnectionEventListener(l);
        }
        connections.add(connection);
        return connection.getConnection(subject, info);
    }
View Full Code Here

                }
                return;
            }
            try {
                ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
                ManagedConnection matchedMC =
                        newMCI
                        .getManagedConnectionFactory()
                        .matchManagedConnections(Collections.singleton(newMCI.getManagedConnection()),
                                mci.getSubject(),
                                mci.getConnectionRequestInfo());
View Full Code Here

TOP

Related Classes of javax.resource.spi.ManagedConnection

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.