Examples of AQQueue


Examples of oracle.AQ.AQQueue

    private List<String> getSubscribers(DestinationConfig destination)
            throws AQException, SQLException, JMSException {
        Connection conn = session.getDBConnection();
        List<String> list = new ArrayList<String>();
        AQSession aqSession = new AQOracleSession(conn);
        AQQueue queue = aqSession.getQueue(conn.getMetaData().getUserName(),
                destination.getName());
        if (queue != null) {
            AQAgent[] subscribers = queue.getSubscribers();
            if (subscribers != null) {
                for (int index = 0; index < subscribers.length; index++) {
                    list.add(subscribers[index].getName());
                }
            }
        }
        queue.close();
        aqSession.close();
        return list;
    }
View Full Code Here

Examples of oracle.AQ.AQQueue

    }

    public void removeSubscriber(DestinationConfig dConfig, boolean remList)
            throws JMSException {
        AQSession aqSession = null;
        AQQueue aqQueue = null;
        if (hermes.getSession() != null) {
            try {
                AQjmsSession aqjmsSession = (AQjmsSession) hermes.getSession();
                Class.forName(AQ_DRIVER_CLASS);
                Connection conn = aqjmsSession.getDBConnection();
                aqSession = AQDriverManager.createAQSession(conn);
                aqQueue = aqSession.getQueue(conn.getMetaData().getUserName(),
                        dConfig.getName());
                AQAgent[] aqAgents = aqQueue.getSubscribers();
                String clientId = dConfig.getClientID();
                clientId = clientId.replaceAll("\"", "");
                LOG.info("Client id is " + clientId);
                for (int i = 0; i < aqAgents.length; i++) {
                    // LOG.debug("Durable Subscriber Name is "
                    // + aqAgents[i].getName());
                    // AQ keeps them as uppercase, unfortunate
                    LOG.debug("AQ agent is " + aqAgents[i].getName());
                    if (aqAgents[i].getName().equals(clientId.toUpperCase())) {
                        LOG.debug("Before remove subscriber "
                                + aqAgents[i].getName());
                        aqQueue.removeSubscriber(aqAgents[i]);
                        LOG.info("Successfully removed durable subscriber "
                                + clientId + " for topic " + dConfig.getName());
                        break;
                    }
                }
            } catch (AQException e) {
                final String msg = "AQ Exception encountered , check log (hermes.log) for more details ";
                LOG.error(msg, e);
            } catch (SQLException e) {
                final String msg = "SQL Exception encountered , check log (hermes.log) for more details ";
                LOG.error(msg, e);
            } catch (ClassNotFoundException e) {
                final String msg = "ClassNotFoundException encountered , check log (hermes.log) for more details ";
                LOG.error(msg, e);
            } finally {
                if (aqQueue != null) {
                    aqQueue.close();
                }
                if (aqSession != null) {
                    aqSession.close();
                }
            }
View Full Code Here

Examples of oracle.AQ.AQQueue

          AQQueueProperty prop = new AQQueueProperty();
          // TODO The setMultiConsumer() is not yet available in this version of the
          // aqapi.jar library.
          //if (multiconsumer) prop.setMultiConsumer(true);

          AQQueue queue = table.createQueue (name, prop);
          queue.start();
       }
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.