Examples of ConnectionManager


Examples of org.jboss.soa.esb.persistence.manager.ConnectionManager

               
                //Drop what is there now, if exists. We want to start fresh.               
                String sqlCreateCmd    = TestEnvironmentUtil.readTextFile(new File(resourceDir.getCanonicalPath() + "/message-store-sql/hsqldb/create_database.sql"));
                String sqlDropCmd      = TestEnvironmentUtil.readTextFile(new File(resourceDir.getAbsolutePath() + "/message-store-sql/hsqldb/drop_database.sql"));
               
                ConnectionManager mgr = ConnectionManagerFactory.getConnectionManager();
                mgr.init();
                Connection con = mgr.getConnection();
                Statement stmnt = con.createStatement();
                System.out.println("Dropping the schema if exist");
                stmnt.execute(sqlDropCmd);
                System.out.println("Creating the message store schema");
                stmnt.execute(sqlCreateCmd);
            } else if ("com.mysql.jdbc.Driver".equals(Configuration.getStoreDriver())) {
               
                String sqlCreateCmd    = TestEnvironmentUtil.readTextFile(new File(resourceDir.getCanonicalPath() + "/message-store-sql/mysql/create_database.sql"));
                String sqlDropCmd      = TestEnvironmentUtil.readTextFile(new File(resourceDir.getCanonicalPath() + "/message-store-sql/mysql/drop_database.sql"));
               
                ConnectionManager mgr = ConnectionManagerFactory.getConnectionManager();
                mgr.init();
                Connection con = mgr.getConnection();
                Statement stmnt = con.createStatement();
                System.out.println("Dropping the schema if exist");
                stmnt.execute(sqlDropCmd);
                System.out.println("Creating the message store schema");
                stmnt.execute(sqlCreateCmd);
View Full Code Here

Examples of org.jivesoftware.openfire.ConnectionManager

    public static void setServiceEnabled(boolean enabled) throws ModificationNotAllowedException {
        // Alert listeners about this event
        for (ExternalComponentManagerListener listener : listeners) {
            listener.serviceEnabled(enabled);
        }
        ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
        connectionManager.enableComponentListener(enabled);
    }
View Full Code Here

Examples of org.jvnet.glassfish.comms.clb.proxy.outbound.ConnectionManager

    }
    /**
     * Creates a new instance of HttpProxy
     */
    private HttpProxy() {
        connectionManager = new ConnectionManager();
        connectionManager.createConnectionHandlerPool();
        layerHandler = new ProxyLayerHandler();
        _logger = ProxyConfig.getInstance().getLogger();
        retryAttempts = ProxyConfig.getInstance().getSendRetryCount();
        AdminEventListenerRegistry.addEventListener(
View Full Code Here

Examples of org.netbeans.api.db.explorer.ConnectionManager

    * @param projName the name of the project to look for
    * @return the valid database connection, or null if a connection could
    * not be successfully opened
    */
   public static Connection getDBConnection(String dbName, String projName) {
      ConnectionManager cMgr = ConnectionManager.getDefault();
      DatabaseConnection[] dbconnList = cMgr.getConnections();
      DatabaseConnection dbconn = null;
      // find a connection for given database & project, if one exists
      System.out.println("DBConnList size: " + dbconnList.length);
      if (dbconnList.length > 0) {
         for (DatabaseConnection con : dbconnList) {
            String name = con.getDisplayName().toLowerCase();
System.out.println(con.getDisplayName());
            if (name.contains(dbName) && name.contains(projName)) {
               dbconn = con;
            }
         }
      }
     
      if (dbconn == null) {
         // TODO: create a connection here if none found
         return null;
      } else {
         System.out.println("Got db connection: " + dbconn.getName());
//         System.out.println("  Driver: " + dbconn.getJDBCDriver().getName());
//         System.out.println("     URL: " + dbconn.getDatabaseURL());
//         System.out.println("    user: " + dbconn.getUser());
//         System.out.println("  schema: " + dbconn.getSchema());
      }
      Connection connection = dbconn.getJDBCConnection();
      if (connection == null) {
         cMgr.showConnectionDialog(dbconn);
      }
      return connection;
   }
View Full Code Here

Examples of org.opensolaris.opengrok.jdbc.ConnectionManager

    @Override
    public void initialize() throws HistoryException {
        try {
            connectionManager =
                    new ConnectionManager(jdbcDriverClass, jdbcConnectionURL);
            for (int i = 0;; i++) {
                final ConnectionResource conn =
                        connectionManager.getConnectionResource();
                try {
                    try (Statement stmt = conn.createStatement()) {
View Full Code Here

Examples of org.rssowl.core.connection.ConnectionManager

   * @throws Exception
   */
  @Test
  @SuppressWarnings("nls")
  public void testProtectedFeed() throws Exception {
    ConnectionManager conManager = ConnectionManager.getDefault();
    ICredentialsProvider credProvider = conManager.getCredentialsProvider();

    URL feedUrl = new URL("http://www.rssowl.org/rssowl2dg/tests/connection/authrequired/feed_rss.xml");
    IFeed feed = new Feed(feedUrl);
    AuthenticationRequiredException e = null;

    try {
      conManager.load(feed.getLink());
    } catch (AuthenticationRequiredException e1) {
      e = e1;
    }

    assertNotNull(e);

    ICredentials credentials = new ICredentials() {
      public String getDomain() {
        return null;
      }

      public String getPassword() {
        return "admin";
      }

      public String getUsername() {
        return "bpasero";
      }
    };

    credProvider.setAuthCredentials(credentials, feedUrl);

    InputStream inS = conManager.load(feed.getLink());
    assertNotNull(inS);

    Interpreter.getDefault().interpret(inS, feed);
    assertEquals("RSS 2.0", feed.getFormat());
  }
View Full Code Here

Examples of org.rssowl.core.connection.ConnectionManager

   * @throws Exception
   */
  @Test
  @SuppressWarnings("nls")
  public void testHTTPFeed() throws Exception {
    ConnectionManager conManager = ConnectionManager.getDefault();
    URL feedUrl = new URL("http://www.rssowl.org/rssowl2dg/tests/connection/rss_2_0.xml");
    IFeed feed = new Feed(feedUrl);

    InputStream inS = conManager.load(feed.getLink());
    assertNotNull(inS);

    Interpreter.getDefault().interpret(inS, feed);
    assertEquals("RSS 2.0", feed.getFormat());
  }
View Full Code Here

Examples of org.rssowl.core.connection.ConnectionManager

   * @throws Exception
   */
  @Test
  @SuppressWarnings("nls")
  public void testHTTPSFeed() throws Exception {
    ConnectionManager conManager = ConnectionManager.getDefault();
    URL feedUrl = new URL("https://sourceforge.net/export/rss2_projnews.php?group_id=141424&rss_fulltext=1");
    IFeed feed = new Feed(feedUrl);

    InputStream inS = conManager.load(feed.getLink());
    assertNotNull(inS);

    Interpreter.getDefault().interpret(inS, feed);
    assertEquals("RSS 2.0", feed.getFormat());
  }
View Full Code Here

Examples of org.rssowl.core.connection.ConnectionManager

   */
  @Test
  @SuppressWarnings("nls")
  public void testFILEFeed() throws Exception {
    URL pluginLocation = FileLocator.toFileURL(Platform.getBundle("org.rssowl.core.tests").getEntry("/"));
    ConnectionManager conManager = ConnectionManager.getDefault();
    URL feedUrl = pluginLocation.toURI().resolve("data/interpreter/feed_rss.xml").toURL();
    IFeed feed = new Feed(feedUrl);

    InputStream inS = conManager.load(feed.getLink());
    assertNotNull(inS);

    Interpreter.getDefault().interpret(inS, feed);
    assertEquals("RSS 2.0", feed.getFormat());
  }
View Full Code Here

Examples of org.rssowl.core.connection.ConnectionManager

   * @throws Exception
   */
  @Test
  @SuppressWarnings("nls")
  public void testCustomProtocol() throws Exception {
    ConnectionManager conManager = ConnectionManager.getDefault();
    URL feedUrl = new URL("myprotocol://data/interpreter/feed_rss.xml");
    IFeed feed = new Feed(feedUrl);

    InputStream inS = conManager.load(feed.getLink());
    assertNotNull(inS);

    Interpreter.getDefault().interpret(inS, feed);
    assertEquals("RSS 2.0", feed.getFormat());
  }
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.