Example usage for javax.xml.registry JAXRException getLocalizedMessage

List of usage examples for javax.xml.registry JAXRException getLocalizedMessage

Introduction

In this page you can find the example usage for javax.xml.registry JAXRException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:it.cnr.icar.eric.client.ui.swing.JAXRClient.java

/**
 * Makes a connection to a JAXR Registry.
 *
 * @param url The URL of the registry.//from  w  w  w. ja  v a  2 s. c om
 * @return boolean true if connected, false otherwise.
 */
public synchronized boolean createConnection(String url) {
    try {
        if (!RegistryBrowser.localCall) {
            (new URL(url)).openStream().read();
        }

        Thread.currentThread().setContextClassLoader(RegistryBrowser.getInstance().classLoader);

        ProviderProperties.getInstance().put("javax.xml.registry.queryManagerURL", url);

        ConnectionFactory connFactory = JAXRUtility.getConnectionFactory();

        connection = (it.cnr.icar.eric.client.xml.registry.ConnectionImpl) connFactory.createConnection();
        RegistryService service = connection.getRegistryService();
        bqm = service.getBusinessQueryManager();
        dqm = (it.cnr.icar.eric.client.xml.registry.DeclarativeQueryManagerImpl) service
                .getDeclarativeQueryManager();
        lcm = (it.cnr.icar.eric.client.xml.registry.BusinessLifeCycleManagerImpl) service
                .getBusinessLifeCycleManager();

        lmm = connection.getLoginModuleManager();
        lmm.setParentFrame(RegistryBrowser.getInstance());
        connected = true;
    } catch (final JAXRException e) {
        connected = false;
        String msg = JavaUIResourceBundle.getInstance().getString("message.error.failedConnecting",
                new String[] { url, e.getLocalizedMessage() });
        log.error(msg, e);
        RegistryBrowser.displayError(msg, e);
    } catch (MalformedURLException e) {
        connected = false;
        String msg = JavaUIResourceBundle.getInstance().getString("message.error.failedConnecting",
                new String[] { url, e.getLocalizedMessage() });
        log.error(msg, e);
        RegistryBrowser.displayError(msg, e);
    } catch (IOException e) {
        connected = false;
        String msg = JavaUIResourceBundle.getInstance().getString("message.error.failedConnecting",
                new String[] { url, e.getLocalizedMessage() });
        log.error(msg, e);
        RegistryBrowser.displayError(msg, e);
    }
    return connected;
}

From source file:it.cnr.icar.eric.client.ui.swing.AdhocQuerySearchPanel.java

private AdhocQueryImpl getAdhocQuery(QueryType uiQueryType) {
    AdhocQueryImpl adhocQuery = null;/*  w  ww .java  2 s  . c  om*/
    ObjectRefType queryRef = uiQueryType.getAdhocQueryRef();
    String queryId = queryRef.getId();
    try {
        Object adhocQueryObj = queryToAdhocQueryMap.get(uiQueryType);
        if (adhocQueryObj == null) {
            adhocQuery = (AdhocQueryImpl) dqm.getRegistryObject(queryId); //, "AdhocQuery");
            if (adhocQuery == null) {
                String msg = resourceBundle.getString("message.error.failedLoadingAdhocQuery.notFound",
                        new String[] { queryId });
                log.warn(msg);

                queryToAdhocQueryMap.put(uiQueryType, Boolean.FALSE);
            } else {
                queryToAdhocQueryMap.put(uiQueryType, adhocQuery);
            }
        } else {
            if (adhocQueryObj instanceof AdhocQueryImpl) {
                adhocQuery = (AdhocQueryImpl) adhocQueryObj;
            }
        }
    } catch (JAXRException e) {
        String msg = resourceBundle.getString("message.error.failedLoadingAdhocQuery.exception",
                new String[] { queryId, e.getLocalizedMessage() });
        log.warn(msg, e);
        RegistryBrowser.displayError(msg, e);
    }

    return adhocQuery;
}