Search in sources :

Example 1 with ManagedConnectionFactoryImpl

use of org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl in project cxf by apache.

the class OutBoundConnectionTest method testGetConnectionFromSEI.

@Test
@org.junit.Ignore
public void testGetConnectionFromSEI() throws Exception {
    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);
}
Also used : ManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory) CXFConnectionRequestInfo(org.apache.cxf.jca.cxf.CXFConnectionRequestInfo) ManagedConnectionFactoryImpl(org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl) ManagedConnection(javax.resource.spi.ManagedConnection) Test(org.junit.Test)

Example 2 with ManagedConnectionFactoryImpl

use of org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl in project cxf by apache.

the class OutBoundConnectionTest method testBasicConnection.

@Test
@org.junit.Ignore
public void testBasicConnection() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
    assertNotNull(wsdl);
    SOAPService service = new SOAPService(wsdl, serviceName);
    assertNotNull(service);
    CXFConnectionRequestInfo cri = new CXFConnectionRequestInfo(Greeter.class, wsdl, 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();
    } catch (WebServiceException ex) {
        fail("The connection object should support Object method");
    }
    verifyResult(o);
}
Also used : SOAPService(org.apache.hello_world_soap_http.SOAPService) ManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory) WebServiceException(javax.xml.ws.WebServiceException) CXFConnectionRequestInfo(org.apache.cxf.jca.cxf.CXFConnectionRequestInfo) ManagedConnectionFactoryImpl(org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl) ManagedConnection(javax.resource.spi.ManagedConnection) URL(java.net.URL) Subject(javax.security.auth.Subject) Test(org.junit.Test)

Example 3 with ManagedConnectionFactoryImpl

use of org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl in project cxf by apache.

the class ProxyInvocationHandler method invoke.

public final Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
    LOG.fine(this + " on " + method);
    Object o = getData().getManagedConnection().getManagedConnectionFactory();
    ManagedConnectionFactoryImpl mcf = (ManagedConnectionFactoryImpl) o;
    // NOTE reset the inited bus to current ,so CXF-rt can play with JCA setup bus
    Bus bus = mcf.getBus();
    BusFactory.setDefaultBus(bus);
    return invokeNext(proxy, method, args);
}
Also used : Bus(org.apache.cxf.Bus) ManagedConnectionFactoryImpl(org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl)

Aggregations

ManagedConnectionFactoryImpl (org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl)3 ManagedConnection (javax.resource.spi.ManagedConnection)2 ManagedConnectionFactory (javax.resource.spi.ManagedConnectionFactory)2 CXFConnectionRequestInfo (org.apache.cxf.jca.cxf.CXFConnectionRequestInfo)2 Test (org.junit.Test)2 URL (java.net.URL)1 Subject (javax.security.auth.Subject)1 WebServiceException (javax.xml.ws.WebServiceException)1 Bus (org.apache.cxf.Bus)1 SOAPService (org.apache.hello_world_soap_http.SOAPService)1