Package com.sun.messaging.bridge.service

Examples of com.sun.messaging.bridge.service.BridgeException


        return _adminQueue.getQueueName();
    }

    public String getAdminDestinationClassName() throws Exception {
        if (_state != State.STARTED) {
            throw new BridgeException(_bmr.getString(_bmr.X_BRIDGE_SERVICE_MANAGER_NOT_RUNNING));
        }
        return _adminQueue.getClass().getName();
    }
View Full Code Here


    /**
     * Start the bridge service manager
     */
    public synchronized void start() throws Exception {
        if (_bc == null || _state == State.UNINITIALIZED) {
            throw new BridgeException(_bmr.getString(_bmr.X_BRIDGE_SERVICE_MANAGER_NOT_INITED));
        }
        _state = State.STARTING;

        Properties props = _bc.getBridgeConfig();

View Full Code Here

        _bc.logInfo("Loading bridge "+name, null);

        Bridge b = _bridges.get(name);
        if (b != null) {
            _bc.logInfo("Bridge "+name+" is already loaded.", null);
           throw new BridgeException(_bmr.getString(_bmr.I_BRIDGE_ALREADY_LOADED, name), Status.NOT_MODIFIED);
        }

        Properties props = _bc.getBridgeConfig();

        /*
        String activekey = props.getProperty(
                                  BridgeBaseContext.PROP_PREFIX)+".activelist";
        List<String> alist = BridgeUtil.getListProperty(activekey, props);
       
        String tmpn = null;
        boolean found = false;
        Iterator<String> itr = alist.iterator();
        while (itr.hasNext()) {
            tmpn = itr.next();
            if (tmpn.equals(name)) {
                found = true;
                break;
            }
        }
        if (!found) {
            String oldactives = props.getProperty(activekey);
            String newactives = oldactives+","+name;
            Properties p = new Properties();
            p.setProperty(activekey, newactives);
            _bc.updateBridgeConfig(p);
        }
        */

        props = _bc.getBridgeConfig();
        String type = props.getProperty(
                      props.getProperty(
                      BridgeBaseContext.PROP_PREFIX)+"."+name+".type");
        if (type == null) {
            String emsg = _bmr.getKString(_bmr.E_LOAD_BRIDGE_NO_TYPE, name);
            _bc.logError(emsg, null);
            throw new BridgeException(emsg);
        }
        type = type.toLowerCase();

        String classn = props.getProperty(
                        props.getProperty(
                        BridgeBaseContext.PROP_PREFIX)+"."+type+".class");

        if (classn == null) {
            String emsg = _bmr.getKString(_bmr.E_LOAD_BRIDGE_NO_CLASS, name);
            _bc.logError(emsg, null);
            throw new BridgeException(emsg);
        }


        b = (Bridge)Class.forName(classn).newInstance();

        if (!b.isMultipliable() && !b.getType().toLowerCase().equals(name.toLowerCase())) {
            String emsg =  _bmr.getKString(_bmr.E_BRIDGE_NAME_TYPE_NOT_SAME, name, b.getType());
            _bc.logError(emsg, null);
            throw new BridgeException(emsg);
        }

        if (DEBUG) {
            _bc.logInfo("Loaded brigde "+name+" by classloader "+
                        b.getClass().getClassLoader()+
View Full Code Here

        }
        Bridge b = null;
        if (name != null) {
            b = _bridges.get(name);
            if (b == null) {
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name));
            }
            if (type != null && !type.equals(b.getType())) {
                String[] eparam = new String[] {name, b.getType(), type};
                throw new  BridgeException(_bmr.getKString(_bmr.X_BRIDGE_TYPE_MISMATCH, eparam));
            }
            return startBridge(b, args);
        }

        boolean async = false;
View Full Code Here

        }
        Bridge b = null;
        if (name != null) {
            b = _bridges.get(name);
            if (b == null) {
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name));
            }
            if (type != null && !type.equals(b.getType())) {
                String[] eparam = new String[] {name, b.getType(), type};
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_TYPE_MISMATCH, eparam));
            }
            stopBridge(b, args);
            return;
        }
View Full Code Here

        }
        Bridge b = null;
        if (name != null) {
            b = _bridges.get(name);
            if (b == null) {
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name));
            }
            if (type != null && !type.equals(b.getType())) {
                String[] eparam = new String[] {name, b.getType(), type};
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_TYPE_MISMATCH, eparam));
            }
            pauseBridge(b, args);
            return;
        }
View Full Code Here

        Bridge b = null;
        if (name != null) {
            b = _bridges.get(name);
            if (b == null) {
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name));
            }
            if (type != null && !type.equals(b.getType())) {
                String[] eparam = new String[] {name, b.getType(), type};
                throw new BridgeException(_bmr.getKString(_bmr.X_BRIDGE_TYPE_MISMATCH, eparam));
            }
            resumeBridge(b, args);
            return;
        }
View Full Code Here

        _bc.logInfo("Unloading bridge "+name, null);

        Bridge b = _bridges.get(name);
        if (b == null) {
            _bc.logInfo("Bridge "+name+" is not loaded."null);
            throw new BridgeException("Bridge "+name+" is not loaded.", Status.NOT_MODIFIED);
        }
        stopBridge(name, null, null);
        _bridges.remove(name);
        b.setName(null);
View Full Code Here

        Bridge b = _bridges.get(name);
        if (b == null) {
            String emsg = _bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name);
            _bc.logError(emsg, null);
            throw new BridgeException(emsg);
        }

        BridgeContext bc = new BridgeContext(_bc, b.getName());
        return b.list(bc, args, bmr);
    }
View Full Code Here

            return;
        }
        synchronized(this) {

        if (_bc == null) {
            throw new BridgeException(_bmr.getString(_bmr.X_BRIDGE_SERVICE_MANAGER_NOT_INITED));
        }
        _state = State.STOPPING;
        try {
            stopBridge(null, null, null);
        } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of com.sun.messaging.bridge.service.BridgeException

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.