Example usage for java.rmi RemoteException getMessage

List of usage examples for java.rmi RemoteException getMessage

Introduction

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

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:org.wso2.carbon.server.admin.ui.ServerAdminClient.java

public boolean shutdown() throws Exception {
    boolean result;
    try {//w  ww . ja  v  a  2s .c o m
        result = serverAdminStub.shutdown();
        if (result) {
            invalidateSession();
        }
    } catch (RemoteException e) {
        String msg = "Cannot shutdown the server. " + e.getMessage();
        log.error(msg, e);
        throw new Exception(msg, e);
    }
    return result;
}

From source file:org.wso2.carbon.server.admin.ui.ServerAdminClient.java

public boolean shutdownGracefully() throws Exception {
    boolean result;
    try {//from  w  ww .ja  va 2s.c  o m
        result = serverAdminStub.shutdownGracefully();
        if (result) {
            invalidateSession();
        }
    } catch (RemoteException e) {
        String msg = "Cannot shutdown the server. " + e.getMessage();
        log.error(msg, e);
        throw new Exception(msg, e);
    }
    return result;
}

From source file:org.wso2.carbon.statistics.ui.StatisticsAdminClient.java

public SystemStatistics getSystemStatistics() throws RemoteException {
    try {/*w  w w  .ja  v  a  2s  . c o m*/
        return stub.getSystemStatistics();
    } catch (RemoteException e) {
        if (e.getMessage().contains("Backend server may be unavailable")) {
            log.debug("Backend server may be unavailable", e);
            throw new RemoteException("Backend server may be unavailable", e);
        }

        handleException(bundle.getString("cannot.get.system.stats"), e);
    }
    return null;
}

From source file:org.wso2.carbon.statistics.ui.StatisticsAdminClient.java

public ServiceStatistics getServiceStatistics(String serviceName) throws RemoteException {
    try {//from  ww w.  j  av  a2  s.c om
        return stub.getServiceStatistics(serviceName);
    } catch (RemoteException e) {
        if (e.getMessage().contains("Backend server may be unavailable")) {
            log.debug("Backend server may be unavailable", e);
            return null;
        }

        handleException(MessageFormat.format(bundle.getString("cannot.get.service.stats"), serviceName), e);
    }
    return null;
}

From source file:org.wso2.carbon.statistics.ui.StatisticsAdminClient.java

public StatisticData getWebappStatistics(String webApp) throws Exception {
    //        StatisticData statisticData = null;
    try {//from  ww  w  .  j  a  va  2  s  .c  om
        StatisticData statisticData = stub.getWebappRelatedData(webApp);
        if (statisticData == null) {
            statisticData = new StatisticData();
            statisticData.setRequstCount(0);
            statisticData.setResponseCount(0);
            statisticData.setFaultCount(0);
            statisticData.setMaximumResponseTime(0.0);
            statisticData.setMinimumresponseTime(0.0);
            statisticData.setAverageResponseTime(0.0);
        }
        return statisticData;
    } catch (RemoteException e) {
        if (e.getMessage().contains("Backend server may be unavailable")) {
            log.debug("Backend server may be unavailable", e);
            throw new RemoteException("Backend server may be unavailable", e);
        }

        if (e.getMessage().contains("The input stream for an incoming message is null.")) {
            log.debug("Backend server may be unavailable", e);
            throw new RemoteException("Backend server may be unavailable", e);
        }

        handleException(bundle.getString("cannot.get.webapps.stats"), e);
    }

    return null;

}

From source file:org.wso2.carbon.ui.AbstractCarbonUIAuthenticator.java

/**
 * //ww w. j av a 2  s . c om
 * @param credentials
 * @param rememberMe
 * @param request
 * @throws AxisFault
 */
@SuppressWarnings("rawtypes")
public void handleSecurity(Object credentials, boolean rememberMe, HttpServletRequest request)
        throws AuthenticationException {

    regenrateSession(request);

    String backendServerURL = getBackendUrl(request);
    HttpSession session = request.getSession();
    LoggedUserInfoAdminStub stub;
    String loggedinUser = null;

    if (backendServerURL == null) {
        throw new AuthenticationException("Server not initialized properly.");
    }

    try {

        stub = getLoggedUserInfoAdminStub(backendServerURL, session);
        ServiceClient client = stub._getServiceClient();

        // In side this method - Authenticators should complete the authentication with the
        // back-end service Or - it should set the required authentication headers, there are
        // required in future service calls. Also each Authenticator should know how to handle
        // the Remember Me logic.
        loggedinUser = doAuthentication(credentials, rememberMe, client, request);

        if (isAdminCookieSet()) {
            // If the UI Authenticator takes the responsibility of setting the Admin Cookie,it
            // has to set the value in the session with the key
            // ServerConstants.ADMIN_SERVICE_AUTH_TOKEN.
            client.getServiceContext().setProperty(HTTPConstants.COOKIE_STRING,
                    session.getAttribute(ServerConstants.ADMIN_SERVICE_AUTH_TOKEN));
        }

        // By now, user is authenticated or proper authentication headers been set. This call
        // set retrieve user authorization information from the back-end.
        setUserAuthorizationInfo(stub, session);

        if (!isAdminCookieSet()) {
            // If authentication successful set the cookie.
            // Authenticators them selves have not set the cookie.
            setAdminCookie(session, client, null);
        }

        // Process remember me data in reply
        if (rememberMe) {
            OperationContext operationContext = client.getLastOperationContext();
            MessageContext inMessageContext;
            Map transportHeaders;
            inMessageContext = operationContext.getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN);
            transportHeaders = (Map) inMessageContext.getProperty(MessageContext.TRANSPORT_HEADERS);
            handleRememberMe(transportHeaders, request);
        }

        onSuccessAdminLogin(request, loggedinUser);

    } catch (RemoteException e) {
        throw new AuthenticationException(e.getMessage(), e);
    } catch (Exception e) {
        throw new AuthenticationException("Exception occurred while accessing user authorization info", e);
    }
}

From source file:org.wso2.carbon.um.ws.api.WSClaimManager.java

@Override
public String getAttributeName(String domainName, String claimURI)
        throws org.wso2.carbon.user.api.UserStoreException {
    try {/* w ww .java2s  . c  o  m*/
        return stub.getAttributeNameFromDomain(domainName, claimURI);
    } catch (RemoteException e) {
        this.handleException(e.getMessage(), e);
    } catch (RemoteClaimManagerServiceUserStoreExceptionException e) {
        this.handleException(e.getMessage(), e);
    }
    return null;
}

From source file:org.wso2.carbon.um.ws.api.WSClaimManager.java

@Override
public org.wso2.carbon.user.api.ClaimMapping[] getAllSupportClaimMappingsByDefault()
        throws org.wso2.carbon.user.api.UserStoreException {
    try {//w  w w  .j  a va 2 s  .  c  om
        return WSRealmUtil.convertToClaimMappings(stub.getAllSupportClaimMappingsByDefault());
    } catch (RemoteException e) {
        this.handleException(e.getMessage(), e);
    } catch (RemoteClaimManagerServiceUserStoreExceptionException e) {
        this.handleException(e.getMessage(), e);
    }
    return new ClaimMapping[0];
}

From source file:org.wso2.carbon.um.ws.api.WSClaimManager.java

@Override
public org.wso2.carbon.user.api.ClaimMapping[] getAllClaimMappings()
        throws org.wso2.carbon.user.api.UserStoreException {
    try {//from w ww  .  j a v  a  2s  .  com
        return WSRealmUtil.convertToClaimMappings(stub.getAllClaimMappings(null));
    } catch (RemoteException e) {
        this.handleException(e.getMessage(), e);
    } catch (RemoteClaimManagerServiceUserStoreExceptionException e) {
        this.handleException(e.getMessage(), e);
    }
    return new ClaimMapping[0];
}

From source file:org.wso2.carbon.um.ws.api.WSClaimManager.java

@Override
public org.wso2.carbon.user.api.ClaimMapping[] getAllClaimMappings(String dialectURI)
        throws org.wso2.carbon.user.api.UserStoreException {
    try {// w w w.j  a  v a 2 s .  com
        return WSRealmUtil.convertToClaimMappings(stub.getAllClaimMappings(null));
    } catch (RemoteException e) {
        this.handleException(e.getMessage(), e);
    } catch (RemoteClaimManagerServiceUserStoreExceptionException e) {
        this.handleException(e.getMessage(), e);
    }
    return new ClaimMapping[0];
}