Package com.sun.appserv.connectors.internal.api

Examples of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException


    public MBeanServerConnection getMQMBeanServerConnection() throws ConnectorRuntimeException {
        try {
            if (getJMXServiceURL() == null || getJMXServiceURL().equals("")) {
                String msg = localStrings.getLocalString("error.get.jmsserviceurl",
                                "Failed to get MQ JMXServiceURL of {0}.", getASInstanceName());
                throw new ConnectorRuntimeException(msg);
            }
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE,
                "creating MBeanServerConnection to MQ JMXServer with "+getJMXServiceURL());
            }
            JMXServiceURL jmxServiceURL = new JMXServiceURL(getJMXServiceURL());
            connector = JMXConnectorFactory.connect(jmxServiceURL, this.jmxConnectorEnv);
            //XXX: Do we need to pass in a Subject?
            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
            return mbsc;
        } catch (Exception e) {
            e.printStackTrace();
            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
            cre.initCause(e);
            throw cre;
        }
    }
View Full Code Here


        try {
           if (connector != null) {
                 connector.close();
           }
        } catch (IOException e) {
            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
            cre.initCause(e);
            throw cre;
        }
    }
View Full Code Here

                   });

                   return new MQJMXConnectorInfo[]{mqjmxForServer};
               } catch (Exception e) {
                   //e.printStackTrace();
                   ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
                   cre.initCause(e);
                   throw cre;
               }
           }
View Full Code Here

                                   ActiveJmsResourceAdapter.getBrokerInstanceName(jmsService) ,
                                   jmsService.getType(), jmxServiceURL, jmxConnectorEnv);
                   return mqInfo;
               } catch (Exception e) {
                   e.printStackTrace();
                   ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
                   cre.initCause(e);
                   throw cre;
               }
           }
View Full Code Here

                     String domainurl  = serverContext.getServerConfigURL();
                     java.util.Map<String,JmsHost> hostMap =  list.getResolvedLocalJmsHostsInMyCluster(true);

                     if ( hostMap.size() == 0 ) {
                         String msg = localStrings.getLocalString("mqjmx.no_jms_hosts", "No JMS Hosts Configured");
                         throw new ConnectorRuntimeException(msg);

                     }


                     for (JmsHost host : hostMap.values()) {
                         list.addMQUrl(host);
                     }
                 }

              String connectionUrl = list.toString();
              String adminUserName = null;
              String adminPassword = null;
              JmsHost jmsHost = list.getDefaultJmsHost(jmsService);
              if (jmsHost != null){// && jmsHost.isEnabled()) {
                  adminUserName = jmsHost.getAdminUserName();
                  adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
              } else {
                  logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
              }
               raInstance = getConfiguredRA(mqRAClassName, connectionUrl,
                                           adminUserName, adminPassword);
             } catch (Exception e) {
                 e.printStackTrace();
                 ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
                 cre.initCause(e);
                 throw cre;
             }

             try {
                 String jmxServiceURL = null, jmxServiceURLList = null;
                 Map<String, ?> jmxConnectorEnv = null;
                 Method[] methds = raInstance.getClass().getMethods();
                 for (int i = 0; i < methds.length; i++) {
                     Method m = methds[i];
                     if (m.getName().equalsIgnoreCase("get" + JMXSERVICEURLLIST)){
                         jmxServiceURLList = (String)m.invoke(raInstance, new Object[]{});
                         if (jmxServiceURLList != null && !jmxServiceURLList.trim().equals("")){
                             jmxServiceURL = getFirstJMXServiceURL(jmxServiceURLList);
                         }
                     } else if (m.getName().equalsIgnoreCase("get" + JMXCONNECTORENV)){
                         jmxConnectorEnv = (Map<String,?>)m.invoke(raInstance, new Object[]{});
                     }
                 }
                 MQJMXConnectorInfo mqInfo = new MQJMXConnectorInfo(target,
                                 ActiveJmsResourceAdapter.getBrokerInstanceName(jmsService) ,
                                 jmsService.getType(), jmxServiceURL, jmxConnectorEnv);
                 return mqInfo;
             } catch (Exception e) {
                 e.printStackTrace();
                 ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
                 cre.initCause(e);
                 throw cre;
             }
         }
View Full Code Here

            //XXX: Do we need to pass in a Subject?
            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
            return mbsc;
        } catch (Exception e) {
            //e.printStackTrace();
            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
            cre.initCause(e);
            throw cre;
        }
    }
View Full Code Here

        try {
           if (connector != null) {
                 connector.close();
           }
        } catch (IOException e) {
            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
            cre.initCause(e);
            throw cre;
        }
    }
View Full Code Here

                        logger.finest("Got the thread pool [ "+threadPoolId+" ] for WorkManager of RAR [ "+raName+" ]");
                    }
                } catch (NoSuchThreadPoolException e) {
                    String msg = localStrings.getString("workmanager.threadpool_not_found", new Object[]{threadPoolId});
                    logger.log(Level.SEVERE,msg);
                    ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
                    cre.initCause(e);
                    throw cre;
                }
            }
            if (tp == null) {
                // in case the default thread-pool was not available.
                // Set the message appropriately.
                if(threadPoolId == null){
                    threadPoolId = "default thread-pool of server";
                }
                String msg = localStrings.getString("workmanager.threadpool_not_found", new Object[]{threadPoolId});
                logger.log(Level.SEVERE, msg);
                throw new ConnectorRuntimeException(msg);
            }
            registerWithMonitoringService();
        }
    }
View Full Code Here

                    logger.info(message);
                }else if(resourceAdapters.size()<=0){
                    String message = localStrings.getString("msg-bean-client.could-not-detect-ra-mid",
                            descriptor_.getMessageListenerType() );

                    throw new ConnectorRuntimeException(message);
                }else{
                    String message = localStrings.getString("msg-bean-client.multiple-ras-supporting-message-listener",
                            messageListener);
                    throw new ConnectorRuntimeException(message);
                }
            }
        }
        ActiveInboundResourceAdapter aira = getActiveResourceAdapter(resourceAdapterMid);

        aira.updateMDBRuntimeInfo(descriptor_,
                                       messageBeanPM_.getPoolDescriptor());

        //the resource adapter this MDB client is deployed to
        ResourceAdapter ra = aira.getResourceAdapter();

        if(ra == null){
            String i18nMsg = localStrings.getString("msg-bean-client.ra.class.not.specified", resourceAdapterMid);
            throw new ConnectorRuntimeException(i18nMsg);
        }

        ConnectorDescriptor desc = aira.getDescriptor();

        MessageListener msgListener = getMessageListener(desc);
View Full Code Here

            activeRar = registry_.getActiveResourceAdapter(resourceAdapterMid);
        }

        if (activeRar == null) {
            String msg = "Resource adapter " + resourceAdapterMid + " is not deployed";
            throw new ConnectorRuntimeException(msg);
        }

        if (!(activeRar instanceof ActiveInboundResourceAdapter)) {
            throw new Exception("Resource Adapter selected doesn't support Inbound");
        }
View Full Code Here

TOP

Related Classes of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException

Copyright © 2018 www.massapicom. 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.