provider.addCloseHandler((closed, exception) -> { registration.closeAsync(); closeTick1(closed); } finally { if (! ok) { provider.close();
XnioSsl xnioSsl = new JsseXnioSsl(context.getXnio(), options); FutureResult<ConnectionHandlerFactory> result = new FutureResult<ConnectionHandlerFactory>(); instance.connect(null, destination, options, result, new CallbackHandler() {
protected void closeAction() throws IOException { synchronized (connectionLock) { // Commence phase one shutdown actions int res; do { res = resourceCount; } while (! resourceCountUpdater.compareAndSet(this, res, res | CLOSED_FLAG)); if (res == 0) { finishPhase1(); } else { for (Object connection : connections.toArray()) { ((ConnectionImpl)connection).closeAsync(); } for (ProtocolRegistration protocolRegistration : connectionProviders.values()) { protocolRegistration.getProvider().closeAsync(); } } } }
instance.close();
public <T> T getConnectionProviderInterface(final String uriScheme, final Class<T> expectedType) throws UnknownURISchemeException, ClassCastException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(RemotingPermission.GET_CONNECTION_PROVIDER_INTERFACE); } if (! expectedType.isInterface()) { throw new IllegalArgumentException("Interface expected"); } final ProtocolRegistration protocolRegistration = connectionProviders.get(uriScheme); if (protocolRegistration == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + uriScheme + "\" is installed"); } return expectedType.cast(protocolRegistration.getProvider().getProviderInterface()); }
private void closeSessionFactory(SessionFactory factory) { if(factory instanceof SessionFactoryImpl) { SessionFactoryImpl sf = (SessionFactoryImpl)factory; ConnectionProvider conn = sf.getConnectionProvider(); conn.close(); } factory.close(); }
public <T> T getConnectionProviderInterface(final String uriScheme, final Class<T> expectedType) throws UnknownURISchemeException, ClassCastException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(GET_CONNECTION_PROVIDER_INTERFACE_PERM); } if (! expectedType.isInterface()) { throw new IllegalArgumentException("Interface expected"); } final ConnectionProvider provider = connectionProviders.get(uriScheme); if (provider == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + uriScheme + "\" is installed"); } return expectedType.cast(provider.getProviderInterface()); }
provider.addCloseHandler(new CloseHandler<ConnectionProvider>() { public void handleClose(final ConnectionProvider closed, final IOException exception) { registration.closeAsync(); } finally { if (! ok) { provider.close();
connectionProvider.connect(destination, bindAddress, connectOptions, result, configuration, sslContext, finalFactoryOperator, Collections.emptyList()) ); ok = true;
protected void closeAction() throws IOException { try { provider.closeAsync(); } finally { super.closeAction(); } } };
public <T> T getConnectionProviderInterface(final String uriScheme, final Class<T> expectedType) throws UnknownURISchemeException, ClassCastException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(RemotingPermission.GET_CONNECTION_PROVIDER_INTERFACE); } if (! expectedType.isInterface()) { throw new IllegalArgumentException("Interface expected"); } final ProtocolRegistration protocolRegistration = connectionProviders.get(uriScheme); if (protocolRegistration == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + uriScheme + "\" is installed"); } return expectedType.cast(protocolRegistration.getProvider().getProviderInterface()); }
provider.addCloseHandler((closed, exception) -> { registration.closeAsync(); closeTick1(closed); } finally { if (! ok) { provider.close();
final Cancellable connect = connectionProvider.connect(bindAddress, destination, connectOptions, connHandlerFuture, callbackHandler, xnioSsl); ok = true; futureResult.addCancelHandler(connect);
protected void closeAction() throws IOException { synchronized (connectionLock) { // Commence phase one shutdown actions int res; do { res = resourceCount; } while (! resourceCountUpdater.compareAndSet(this, res, res | CLOSED_FLAG)); if (res == 0) { finishPhase1(); } else { for (Object connection : connections.toArray()) { ((ConnectionImpl)connection).closeAsync(); } for (ConnectionProvider connectionProvider : connectionProviders.values()) { connectionProvider.closeAsync(); } } } }
connectionProvider.connect(destination, bindAddress, connectOptions, result, configuration, sslContext, finalFactoryOperator, Collections.emptyList()) ); ok = true;
protected void closeAction() throws IOException { synchronized (connectionLock) { // Commence phase one shutdown actions int res; do { res = resourceCount; } while (! resourceCountUpdater.compareAndSet(this, res, res | CLOSED_FLAG)); if (res == 0) { finishPhase1(); } else { for (Object connection : connections.toArray()) { ((ConnectionImpl)connection).closeAsync(); } for (ProtocolRegistration protocolRegistration : connectionProviders.values()) { protocolRegistration.getProvider().closeAsync(); } } } }