Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.ExceptionHandler


public class Driver extends JLPCActor implements GoReceiver {
    public Actor doer;

    @Override
    public void processRequest(final Go1 request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("Exception caught by Driver");
                rp.processResponse(null);
            }
View Full Code Here


        send(doer, request, rp);
    }

    @Override
    public void processRequest(final Go2 request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("Exception caught by Driver");
                rp.processResponse(null);
            }
View Full Code Here

     */
    @Override
    final public void acceptEvent(final APCRequestSource apcRequestSource,
            final Request request) throws Exception {
        final RequestSource rs = (RequestSource) apcRequestSource;
        final ExceptionHandler sourceExceptionHandler = rs
                .getExceptionHandler();
        final Mailbox sourceMailbox = rs.getMailbox();
        if (sourceMailbox == mailbox) {
            syncSendEvent(rs, request, sourceExceptionHandler);
            return;
View Full Code Here

        mailbox.setCurrentRequest(jaRequest);
        try {
            setExceptionHandler(null);
            request.processRequest(this, JANoResponse.nrp);
        } catch (final Throwable ex) {
            final ExceptionHandler eh = getExceptionHandler();
            if (eh != null)
                try {
                    eh.process(ex);
                    return;
                } catch (final Throwable x) {
                    getMailboxFactory().eventException(request, x);
                }
            else {
View Full Code Here

            if (!isActive()) {
                return;
            }
            inactive();
            final JARequest oldCurrent = mailbox.getCurrentRequest();
            final ExceptionHandler oldExceptionHandler = mailbox
                    .getExceptionHandler();
            restoreSourceMailbox();
            if (response instanceof Throwable) {
                mailbox.setCurrentRequest(oldCurrent);
                mailbox.setExceptionHandler(oldExceptionHandler);
                if (response instanceof Exception) {
                    throw (Exception) response;
                }
                throw (Error) response;
            }
            try {
                rp.processResponse(response);
            } catch (final Throwable e) {
                throw new TransparentException(e);
            }
            mailbox.setCurrentRequest(oldCurrent);
            mailbox.setExceptionHandler(oldExceptionHandler);
        } else {
            if (response instanceof Throwable) {
                Throwable ex = (Throwable) response;
                final ExceptionHandler exceptionHandler = mailbox
                        .getExceptionHandler();
                if (exceptionHandler != null) {
                    try {
                        exceptionHandler.process(ex);
                        return;
                    } catch (final Throwable x) {
                        ex = x;
                    }
                    mailbox.response(this, ex);
View Full Code Here

        calculator.initialize(mailbox, parent);
    }

    @Override
    public void clear(final Clear request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("Clear => " + exception);
                rp.processResponse(null);
            }
View Full Code Here

        });
    }

    @Override
    public void get(final Get request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("Get => " + exception);
                rp.processResponse(null);
            }
View Full Code Here

        });
    }

    @Override
    public void set(final Set request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("Set " + request.getValue() + " => "
                        + exception);
                rp.processResponse(null);
View Full Code Here

        });
    }

    @Override
    public void add(final Add request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("+ " + request.getValue() + " => "
                        + exception);
                rp.processResponse(null);
View Full Code Here

        });
    }

    @Override
    public void subtract(final Subtract request, final RP rp) throws Exception {
        setExceptionHandler(new ExceptionHandler() {
            @Override
            public void process(final Throwable exception) throws Exception {
                System.out.println("- " + request.getValue() + " => "
                        + exception);
                rp.processResponse(null);
View Full Code Here

TOP

Related Classes of org.agilewiki.jactor.ExceptionHandler

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.