Package org.apache.geronimo.console.jmsmanager

Examples of org.apache.geronimo.console.jmsmanager.DataSourceInfo


                }
            } catch (Exception e) {
                throw new PortletException(e);
            }

            DataSourceInfo info = new DataSourceInfo();
            info.setObjectName(gbeanName);
            info.setName(gbeanName.getKeyProperty("name"));
            try {
                info.setState(new Integer(kernel.getGBeanState(gbeanName)));
                //check if user asked this connection to be tested
                if ((gbeanName.toString().equals(name)) && (check)) {
                    info.setWorking(true);
                    try {
                        Object cf = kernel.invoke(gbeanName, "$getResource");
                        testConnection(cf);
                        info.setMessage("Connected");
                    } catch (Exception e) {
                        Throwable t = e;
                        String message = "Failed: ";
                        if (t.getMessage() != null) {
                            message = message + t.getMessage();
                        } else {
                            while (t.getMessage() == null) {
                                t = t.getCause();
                                if (t != null) {
                                    message = message + t.getMessage();
                                } else {
                                    message = message + "Unknown reason";
                                }
                            }
                        }
                        info.setMessage(message);
                    }
                } else {
                    info.setWorking(false);
                }

            } catch (Exception e) {
                throw new PortletException(e);
            }
View Full Code Here


                }
            } catch (Exception e) {
                throw new PortletException(e);
            }

            DataSourceInfo info = new DataSourceInfo();
            info.setObjectName(gbeanName);
            info.setName(gbeanName.getKeyProperty("name"));
            try {
                info.setState(new Integer(kernel.getGBeanState(gbeanName)));
                //check if user asked this connection to be tested
                if ((gbeanName.toString().equals(name)) && (check)) {
                    info.setWorking(true);
                    try {
                        Object cf = kernel.invoke(gbeanName, "$getResource");
                        testConnection(cf);
                        info.setMessage("Connected");
                    } catch (Exception e) {
                        Throwable t = e;
                        String message = "Failed: ";
                        if (t.getMessage() != null) {
                            message = message + t.getMessage();
                        } else {
                            while (t.getMessage() == null) {
                                t = t.getCause();
                                if (t != null) {
                                    message = message + t.getMessage();
                                } else {
                                    message = message + "Unknown reason";
                                }
                            }
                        }
                        info.setMessage(message);
                    }
                } else {
                    info.setWorking(false);
                }

            } catch (Exception e) {
                throw new PortletException(e);
            }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.console.jmsmanager.DataSourceInfo

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.