Package org.sf.bee.commons.events

Examples of org.sf.bee.commons.events.BeeEvent


        final WebUri uri = new WebUri(target);
        final String password = uri.getQueryParamAsString(REQ_PARAM_PASSWORD);
        if (isValidPassword(password)) {
            final String path = uri.getFilePath();
            if (path.endsWith("/" + CMD_CLOSE)) {
                super.doEvent(new BeeEvent(this, BeeEvents.ON_CLOSE));
            } else if (path.endsWith("/" + CMD_RESTART)) {
                super.doEvent(new BeeEvent(this, BeeEvents.ON_RESTART));
            }
        } else {
            super.getLogger().log(Level.WARNING,
                    "Command {0} with wrong password {1}",
                    new Object[]{uri, password});
View Full Code Here


        final WebUri uri = new WebUri(target);
        final String password = uri.getQueryParamAsString(REQ_PARAM_PASSWORD);
        if (isValidPassword(password)) {
            final String path = uri.getFilePath();
            if (path.endsWith("/" + CMD_CLOSE)) {
                super.doEvent(new BeeEvent(this, BeeEvents.ON_CLOSE));
            } else if (path.endsWith("/" + CMD_RESTART)) {
                super.doEvent(new BeeEvent(this, BeeEvents.ON_RESTART));
            }
        } else {
            super.getLogger().log(Level.WARNING,
                    "Command {0} with wrong password {1}",
                    new Object[]{uri, password});
View Full Code Here

    //                      p r i v a t e
    // ------------------------------------------------------------------------

    private void doAction(){
        if(null!=_listener){
            final BeeEvent event = new BeeEvent(this, ACTION_ID);
            _listener.onEvent(event);
        }
    }
View Full Code Here

    }

    private void notifyListenersOnOpen() {
        //-- NOTIFY onOpen --//
        if (null != _eventNotifier) {
            BeeEvent event = new BeeEvent(this, BeeEvents.ON_OPEN);
            _eventNotifier.doEvent(event);
        }
    }
View Full Code Here

    }

    private void notifyListenersOnClose() {
        //-- NOTIFY onOpen --//
        if (null != _eventNotifier) {
            BeeEvent event = new BeeEvent(this, BeeEvents.ON_CLOSE);
            _eventNotifier.doEvent(event);
        }
    }
View Full Code Here

    private void doOnError(final Throwable t) {
        if (null != _eventListener) {
            final StandardCodedException ex = new StandardCodedException(
                    StandardCodedException.ERROR_500_SERVERERROR, t);
            final BeeEvent event = new BeeEvent(this, BeeEvents.ON_ERROR, ex);
            _eventListener.onEvent(event);
        }
    }
View Full Code Here

                    super.getLogger().info(
                            StringUtils.format("STATUS CHANGED: {0} {1} support tray icon",
                            this.getClass().getSimpleName(),
                            _traySupported?"":"does not"));
                   
                    final BeeEvent event = new BeeEvent(this,
                            _traySupported ? BeeEvents.ON_OK : BeeEvents.ON_NO);
                    _listener.onEvent(event);
                }
                Thread.sleep(SLEEP);
            }
        } catch (InterruptedException iex) {
            // no event for standard interrupted exception
            _interrupted = true;
        } catch (Throwable t) {
            _interrupted = true;
            final BeeEvent event = new BeeEvent(this, BeeEvents.ON_ERROR, t);
            _listener.onEvent(event);
        }
        super.getLogger().info("CLOSED: " + this.getClass().getSimpleName());
    }
View Full Code Here

    //                      p r i v a t e
    // ------------------------------------------------------------------------

    private void doClose(){
        if(null!=_listener){
            final BeeEvent event = new BeeEvent(this, BeeEvents.ON_CLOSE);
            _listener.onEvent(event);
        }
    }
View Full Code Here

        return result;
    }

    private void invokeListeners(final LogItem item) {
        synchronized (_listeners) {
            final BeeEvent event = new BeeEvent(this, BeeEvents.ON_ERROR, item);
            for (final IBeeEventListener listener : _listeners) {
                listener.onEvent(event);
            }
        }
    }
View Full Code Here

    private void invokeLaterOnFinish(final IBeeEventListener callbackHandler) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                callbackHandler.onEvent(new BeeEvent(
                        this,
                        BeeEvents.ON_FINISH,
                        getJob()));
            }
        });
View Full Code Here

TOP

Related Classes of org.sf.bee.commons.events.BeeEvent

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.