Examples of ConnectionManager


Examples of mx4j.tools.remote.ConnectionManager

      JMXServiceURL address = getAddress();
      String protocol = address.getProtocol();
      ConnectionResolver resolver = ConnectionResolver.newConnectionResolver(protocol, environment);
      if (resolver == null) throw new MalformedURLException("Unsupported protocol: " + protocol);

      ConnectionManager server = (ConnectionManager)resolver.lookupClient(address, environment);
      server = (ConnectionManager)resolver.bindClient(server, environment);

      Object credentials = environment == null ? null : environment.get(CREDENTIALS);
      connection = server.connect(credentials);
   }
View Full Code Here

Examples of net.didion.jwnl.dictionary.database.ConnectionManager

    }
    Connection conn = null;

    try {
      //String scriptFileName = args[1];
      ConnectionManager mgr = new ConnectionManager(args[2], args[3],
          args.length <= 4 ? null : args[4], args.length <= 5 ? null
              : args[5]);
      conn = mgr.getConnection();
      DictionaryToDatabase2 d2d = new DictionaryToDatabase2(conn);
      // d2d.createTables(scriptFileName);
      d2d.insertData();

    } catch (Exception e) {
View Full Code Here

Examples of net.jini.jeri.connection.ConnectionManager

    if (canonical != null) {
        return canonical;
    }
      }
      endpoint.connectionManager =
    new ConnectionManager(endpoint.new ConnectionEndpointImpl());
      internTable.put(endpoint, new WeakReference(endpoint));
      return endpoint;
  }
    }
View Full Code Here

Examples of org.adbcj.ConnectionManager

  @Test(timeOut=60000)
  public void testConnectBadCredentials(String url, String user, String password) throws InterruptedException {
    final boolean[] callbacks = {false};
    final CountDownLatch latch = new CountDownLatch(1);

    ConnectionManager connectionManager = ConnectionManagerProvider.createConnectionManager(url, user, "__BADPASSWORD__");
    try {
      DbFuture<Connection> connectFuture = connectionManager.connect().addListener(new DbListener<Connection>() {
        public void onCompletion(DbFuture<Connection> future) throws Exception {
          callbacks[0] = true;
          latch.countDown();
        }
      });
      try {
        connectFuture.get();
        fail("Connect should have failed because of bad credentials");
      } catch (DbException e) {
        assertTrue(connectFuture.isDone(), "Connect future should be marked done even though it failed");
        assertTrue(!connectFuture.isCancelled(), "Connect future should not be marked as cancelled");
      }
      assertTrue(latch.await(1, TimeUnit.SECONDS), "Callback was not invoked in time");
      assertTrue(callbacks[0], "Connect future callback was not invoked with connect failure");
    } finally {
      connectionManager.close(true);
    }
  }
View Full Code Here

Examples of org.apache.curator.x.rpc.connections.ConnectionManager

    }

    public CuratorProjectionServer(Configuration configuration)
    {
        this.configuration = configuration;
        connectionManager = new ConnectionManager(configuration.getConnections(), configuration.getProjectionExpiration().toMillis());
        EventService eventService = new EventService(connectionManager, configuration.getPingTime().toMillis());
        DiscoveryService discoveryService = new DiscoveryService(connectionManager);
        CuratorProjectionService projectionService = new CuratorProjectionService(connectionManager);
        DiscoveryServiceLowLevel discoveryServiceLowLevel = new DiscoveryServiceLowLevel(connectionManager);
        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), Lists.<ThriftEventHandler>newArrayList(), projectionService, eventService, discoveryService, discoveryServiceLowLevel);
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.ConnectionManager

     * This implementation drops the dragged connection to
     * the selected position.
     */
    public void drop( DropTargetEvent event )
    {
        ConnectionManager connectionManager = BrowserCorePlugin.getDefault().getConnectionManager();

        try
        {
            if ( ConnectionTransfer.getInstance().isSupportedType( event.currentDataType ) )
            {
                // get connection to handle
                IConnection[] connections = ( IConnection[] ) event.data;
                IConnection targetConnection = ( IConnection ) event.item.getData();

                if ( event.detail == DND.DROP_MOVE )
                {
                    boolean fromTop = connectionManager.indexOf( connections[0] ) < connectionManager
                        .indexOf( targetConnection );
                    for ( int i = 0; i < connections.length; i++ )
                    {
                        connectionManager.removeConnection( connections[i] );
                    }
                    for ( int i = 0; i < connections.length; i++ )
                    {
                        int index = connectionManager.indexOf( targetConnection );
                        if ( fromTop )
                        {
                            index++;
                            connectionManager.addConnection( index + i, connections[i] );
                        }
                        else
                        {
                            connectionManager.addConnection( index, connections[i] );
                        }
                    }
                }
                else if ( event.detail == DND.DROP_COPY )
                {
                    for ( int i = 0; i < connections.length; i++ )
                    {
                        IConnection newConnection = ( IConnection ) connections[i].clone();
                        int index = connectionManager.indexOf( targetConnection );
                        connectionManager.addConnection( index + i + 1, newConnection );
                    }
                }
            }
            else
            {
View Full Code Here

Examples of org.apache.directory.studio.connection.core.ConnectionManager

     */
    public void run()
    {
        ConnectionFolderManager connectionFolderManager = ConnectionCorePlugin.getDefault()
            .getConnectionFolderManager();
        ConnectionManager connectionManager = ConnectionCorePlugin.getDefault().getConnectionManager();

        ConnectionFolder[] selectedFolders = getSelectedConnectionFolders();
        Connection[] selectedConnections = getSelectedConnections();
        ConnectionFolder targetFolder = null;
        if ( selectedFolders.length > 0 )
        {
            targetFolder = selectedFolders[0];
        }
        else if ( selectedConnections.length > 0 )
        {
            targetFolder = connectionFolderManager.getParentConnectionFolder( selectedConnections[0] );
        }
        if ( targetFolder == null )
        {
            targetFolder = connectionFolderManager.getRootConnectionFolder();
        }

        // connections
        List<Connection> connections = getConnectionsToPaste();
        for ( Connection connection : connections )
        {
            Connection newConnection = ( Connection ) connection.clone();
            connectionManager.addConnection( newConnection );
            targetFolder.addConnectionId( newConnection.getId() );
        }

        // connection folders
        List<ConnectionFolder> connectionFolders = getConnectionFoldersToPaste();
View Full Code Here

Examples of org.apache.directory.studio.connection.core.ConnectionManager

            // Loading the Connections
            ZipEntry connectionsEntry = importFile.getEntry( "connections.xml" ); //$NON-NLS-1$
            if ( connectionsEntry != null )
            {
                InputStream connectionsInputStream = importFile.getInputStream( connectionsEntry );
                ConnectionManager connectionManager = ConnectionCorePlugin.getDefault().getConnectionManager();
                Set<ConnectionParameter> connectionParametersSet = ConnectionIO.load( connectionsInputStream );
                for ( ConnectionParameter connectionParameter : connectionParametersSet )
                {
                    connectionManager.addConnection( new Connection( connectionParameter ) );
                }
            }

            // Loading the ConnectionFolders
            ZipEntry connectionFoldersEntry = importFile.getEntry( "connectionFolders.xml" ); //$NON-NLS-1$
View Full Code Here

Examples of org.apache.geronimo.connector.deployment.jsr88.ConnectionManager

                    for (ConfigPropertySetting setting : settings) {
                        String value = data.properties.get("property-" + setting.getName());
                        setting.setValue(value == null ? "" : value);
                    }
                }
                ConnectionManager manager = instance.getConnectionManager();
                manager.setTransactionLocal(true);
                SinglePool pool = new SinglePool();
                manager.setPoolSingle(pool);
                pool.setMatchOne(true);
                // Max Size needs to be set before the minimum.  This is because
                // the connection manager will constrain the minimum based on the
                // current maximum value in the pool.  We might consider adding a 
                // setPoolConstraints method to allow specifying both at the same time.
View Full Code Here

Examples of org.apache.geronimo.connector.deployment.jsr88.ConnectionManager

                        ConfigPropertySetting setting = settings[i];
                        String value = (String) data.properties.get("property-"+setting.getName());
                        setting.setValue(value == null ? "" : value);
                    }
                }
                ConnectionManager manager = instance.getConnectionManager();
                manager.setTransactionLocal(true);
                SinglePool pool = new SinglePool();
                manager.setPoolSingle(pool);
                pool.setMatchOne(true);
                // Max Size needs to be set before the minimum.  This is because
                // the connection manager will constrain the minimum based on the
                // current maximum value in the pool.  We might consider adding a 
                // setPoolConstraints method to allow specifying both at the same time.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.