Example usage for java.rmi RemoteException getLocalizedMessage

List of usage examples for java.rmi RemoteException getLocalizedMessage

Introduction

In this page you can find the example usage for java.rmi RemoteException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:org.wso2.carbon.event.sink.config.ui.PublishEventMediatorConfigAdminClient.java

/**
 * Invokes services' deleteEventSink method to get All Event Sinks
 *
 * @return status of the deletion as boolean value
 *//*from   w w  w .j  a  v  a 2s.  co  m*/
public boolean deleteEventSink(String name) throws PublishEventMediatorConfigAdminEventSinkException {
    try {
        return stub.deleteEventSink(name);
    } catch (RemoteException e) {
        log.error("Event Sink cannot be deleted, Error: " + e.getLocalizedMessage());
    }
    return false;
}

From source file:org.wso2.carbon.event.sink.config.ui.PublishEventMediatorConfigAdminClient.java

/**
 * Invokes services' getEventSinkFromName method to get Specific Event Sink  detail
 *
 * @return Event Sink corresponds to the given name
 */// w ww.ja  va  2s.  c  om
public org.wso2.carbon.event.sink.xsd.EventSink getEventSinkByName(String name)
        throws PublishEventMediatorConfigAdminEventSinkException {
    org.wso2.carbon.event.sink.xsd.EventSink eventSink = new org.wso2.carbon.event.sink.xsd.EventSink();
    try {
        eventSink = stub.getEventSinkFromName(name);

    } catch (RemoteException e) {
        log.error("Event Sink cannot be deleted, Error: " + e.getLocalizedMessage());
    }
    return eventSink;
}

From source file:org.wso2.carbon.event.sink.config.ui.PublishEventMediatorConfigAdminClient.java

/**
 * Invokes services' writeEventSinkXml method to get All Event Sinks
 *
 * @param eventSink details of the Event Sink to be written
 *///from  w  w  w  . j a  v  a  2s .c  o  m
public void writeEventSinkXml(EventSink eventSink) throws PublishEventMediatorConfigAdminEventSinkException {
    try {
        stub.writeEventSink(eventSink.getName(), eventSink.getUsername(), eventSink.getPassword(),
                eventSink.getReceiverUrlSet(), eventSink.getAuthenticationUrlSet());
    } catch (RemoteException e) {
        log.error("Error occurred while wring Event Sink, Error: " + e.getLocalizedMessage());
    }
}

From source file:org.wso2.carbon.event.sink.config.ui.PublishEventMediatorConfigAdminClient.java

/**
 * Invokes services' updateEventSink method to get All Event Sinks
 *
 * @return status of the update as boolean value
 *///  w w  w  . j a v  a  2 s  .com
public boolean updateEventSink(String name, String username, String password, String receiverUrl,
        String authenticatorUrl) throws PublishEventMediatorConfigAdminEventSinkException {
    try {
        return stub.updateEventSink(name, username, password, receiverUrl, authenticatorUrl);
    } catch (RemoteException e) {
        log.error("Error occurred while updating Event Sink, Error: " + e.getLocalizedMessage());
    }
    return false;
}

From source file:org.wso2.carbon.event.sink.config.ui.PublishEventMediatorConfigAdminClient.java

/**
 * Invokes services' getAllEventSinks method to get All Event Sinks
 *
 * @return list of Event Sinks in the deployment directory
 *//*from   w  w  w  .  j ava  2  s. c o  m*/
public EventSink[] getAllEventSinks() {
    EventSink[] eventSinkList = new EventSink[0];
    try {
        eventSinkList = stub.getAllEventSinks();
    } catch (RemoteException e) {
        log.error("Error Occurred while obtaining list of Event Sinks, Error: " + e.getLocalizedMessage());
    }
    return eventSinkList == null ? new EventSink[0] : eventSinkList;
}

From source file:com.maestrodev.plugins.collabnet.AbstractFrsWorker.java

protected void logoff(CollabNetSession session) {
    try {/*from   ww  w.  ja va 2  s. c o  m*/
        session.logoff();
    } catch (RemoteException e) {
        logger.error("Error logging off from CollabNet TeamForge (ignoring): " + e.getLocalizedMessage(), e);
    }
}

From source file:se.trixon.jota.server.Server.java

private void cronOn() {
    cronOff();//  www  . ja v  a  2s . c o m

    for (Job job : mJobManager.getJobs()) {
        if (job.isCronActive()) {
            for (String cronString : StringUtils.split(job.getCronItems(), "|")) {
                mScheduler.schedule(cronString, () -> {
                    try {
                        if (!isRunning(job)) {
                            startJob(job, false);
                        }
                    } catch (RemoteException ex) {
                        Xlog.timedErr(ex.getLocalizedMessage());
                    }
                });
            }
        }
    }

    mScheduler.start();
}

From source file:se.trixon.jota.client.Client.java

private void startRMI() throws RemoteException {
    try {//from  w ww .j  av  a 2  s. c o  m
        initCallbackServer();
        mManager.connect(mHost, mPortHost);
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            Xlog.timedOut("Shutting down client jvm...");
            try {
                mServerCommander.removeClient(Client.this, SystemHelper.getHostname());
            } catch (RemoteException ex) {
                if (!mShutdownRequested) {
                    Xlog.timedErr(ex.getLocalizedMessage());
                }
            }
        }));
    } catch (NotBoundException | MalformedURLException | java.rmi.server.ExportException
            | java.rmi.ConnectException | java.rmi.ConnectIOException | java.rmi.UnknownHostException
            | SocketException ex) {
        if (mExitOnException) {
            Xlog.timedErr(ex.getLocalizedMessage());
            Jota.exit();
        }
    }
}

From source file:se.trixon.jota.client.Client.java

public void execute(Command command) {
    Xlog.timedOut(command.getMessage());
    try {//from  w w w  .ja v  a2 s  .co  m
        switch (command) {
        case DISPLAY_STATUS:
            Xlog.timedOut(mServerCommander.getStatus());
            break;

        case LIST_JOBS:
            Xlog.timedOut(mServerCommander.listJobs());
            break;

        case LIST_TASKS:
            Xlog.timedOut(mServerCommander.listTasks());
            break;

        case START_CRON:
            mServerCommander.setCronActive(true);
            break;

        case STOP_CRON:
            mServerCommander.setCronActive(false);
            break;

        case SHUTDOWN:
            mShutdownRequested = true;
            mServerCommander.shutdown();
            break;
        }
    } catch (RemoteException ex) {
        if (command != Command.SHUTDOWN) {
            Xlog.timedErr(ex.getLocalizedMessage());
        }
    }
}

From source file:org.talend.mdm.webapp.browserecords.server.servlet.UploadData.java

private void putDocument(WSPutItemWithReportArray wSPutItemWithReportArray, String concept)
        throws UploadException, ServletException {
    try {//from  w  w w  . j ava  2 s . co m
        CommonUtil.getPort().putItemWithReportArray(wSPutItemWithReportArray);
    } catch (RemoteException exception) {
        Throwable cause = UploadUtil.getRootCause(exception);
        if (CoreException.class.isInstance(cause) && cause.getCause() != null) {
            if (MultiRecordsSaveException.class.isInstance(cause.getCause())) {
                throw new UploadException(MESSAGES.getMessage("save_error") + " " //$NON-NLS-1$//$NON-NLS-2$
                        + MESSAGES.getMessage("save_row_count", //$NON-NLS-1$
                                ((MultiRecordsSaveException) cause.getCause()).getRowCount() + 1)
                        + cause.getCause().getMessage());
            }
            throw new UploadException(cause.getCause().getMessage());
        }
        throw new UploadException(cause.getMessage());
    } catch (Exception exception) {
        throw new ServletException(exception.getLocalizedMessage());
    }
}