/** * INTERNAL: */ protected TopicConnectionFactory getTopicConnectionFactory(Context remoteHostContext) { try { return (TopicConnectionFactory)remoteHostContext.lookup(connectionFactoryName); } catch (NamingException e) { RemoteCommandManagerException rcmException = RemoteCommandManagerException.errorLookingUpRemoteConnection(connectionFactoryName, rcm.getUrl(), e); rcm.handleException(rcmException); // If the handler hasn't thrown the exception rethrow it here - it's impossible to recover. throw rcmException; } }
/** * INTERNAL: */ protected Topic getTopic(Context remoteHostContext) { try { return (Topic)remoteHostContext.lookup(topicName); } catch (NamingException e) { RemoteCommandManagerException rcmException = RemoteCommandManagerException.errorLookingUpRemoteConnection(topicName, rcm.getUrl(), e); rcm.handleException(rcmException); // If the handler hasn't thrown the exception rethrow it here - it's impossible to recover. throw rcmException; } }
/** * INTERNAL: */ protected Topic getTopic(Context remoteHostContext) { try { return (Topic)remoteHostContext.lookup(topicName); } catch (NamingException e) { RemoteCommandManagerException rcmException = RemoteCommandManagerException.errorLookingUpRemoteConnection(topicName, rcm.getUrl(), e); rcm.handleException(rcmException); // If the handler hasn't thrown the exception rethrow it here - it's impossible to recover. throw rcmException; } }
/** * INTERNAL: */ protected TopicConnectionFactory getTopicConnectionFactory(Context remoteHostContext) { try { return (TopicConnectionFactory)remoteHostContext.lookup(connectionFactoryName); } catch (NamingException e) { RemoteCommandManagerException rcmException = RemoteCommandManagerException.errorLookingUpRemoteConnection(connectionFactoryName, rcm.getUrl(), e); rcm.handleException(rcmException); // If the handler hasn't thrown the exception rethrow it here - it's impossible to recover. throw rcmException; } }
/** * INTERNAL: */ protected Topic getTopic(Context remoteHostContext) { try { return (Topic)remoteHostContext.lookup(topicName); } catch (NamingException e) { RemoteCommandManagerException rcmException = RemoteCommandManagerException.errorLookingUpRemoteConnection(topicName, rcm.getUrl(), e); rcm.handleException(rcmException); // If the handler hasn't thrown the exception rethrow it here - it's impossible to recover. throw rcmException; } }
/** * INTERNAL: */ protected TopicConnectionFactory getTopicConnectionFactory(Context remoteHostContext) { try { return (TopicConnectionFactory)remoteHostContext.lookup(connectionFactoryName); } catch (NamingException e) { RemoteCommandManagerException rcmException = RemoteCommandManagerException.errorLookingUpRemoteConnection(connectionFactoryName, rcm.getUrl(), e); rcm.handleException(rcmException); // If the handler hasn't thrown the exception rethrow it here - it's impossible to recover. throw rcmException; } }
/** * INTERNAL: * Look the specified remote object up in JNDI and return a Connection to it. */ protected RemoteConnection createConnectionFromJNDI(String remoteObjectIdentifier, String hostURL) { Object[] args = { remoteObjectIdentifier, hostURL }; rcm.logDebug("looking_up_remote_conn_in_jndi", args); try { Context context = getRemoteHostContext(hostURL); //Use JNDI lookup(), rather than the RMI version, //AND replace the Java remote interface cast with a call to javax.rmi.PortableRemoteObject.narrow(): if (this.isRMIOverIIOP()) { return new RMIRemoteConnection((RMIRemoteCommandConnection)PortableRemoteObject.narrow(context.lookup(remoteObjectIdentifier), RMIRemoteCommandConnection.class)); } else { return new RMIRemoteConnection((RMIRemoteCommandConnection)context.lookup(remoteObjectIdentifier)); } } catch (Exception e) { try { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(remoteObjectIdentifier, hostURL, e)); } catch (Exception ex2) { // Must catch this exception and log a debug message rcm.logDebug("unable_to_look_up_remote_conn_in_jndi", args); } } return null; }
/** * INTERNAL: * Look the specified remote object up in JNDI and return a Connection to it. */ protected RemoteConnection createConnectionFromJNDI(String remoteObjectIdentifier, String hostURL) { Object[] args = { remoteObjectIdentifier, hostURL }; rcm.logDebug("looking_up_remote_conn_in_jndi", args); try { Context context = getRemoteHostContext(hostURL); //Use JNDI lookup(), rather than the RMI version, //AND replace the Java remote interface cast with a call to javax.rmi.PortableRemoteObject.narrow(): if (this.isRMIOverIIOP()) { return new RMIRemoteConnection((RMIRemoteCommandConnection)PortableRemoteObject.narrow(context.lookup(remoteObjectIdentifier), RMIRemoteCommandConnection.class)); } else { return new RMIRemoteConnection((RMIRemoteCommandConnection)context.lookup(remoteObjectIdentifier)); } } catch (Exception e) { try { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(remoteObjectIdentifier, hostURL, e)); } catch (Exception ex2) { // Must catch this exception and log a debug message rcm.logDebug("unable_to_look_up_remote_conn_in_jndi", args); } } return null; }
/** * INTERNAL: * Look the specified remote object up in JNDI and return a Connection to it. */ protected RemoteConnection createConnectionFromJNDI(String remoteObjectIdentifier, String hostURL) { Object[] args = { remoteObjectIdentifier, hostURL }; rcm.logDebug("looking_up_remote_conn_in_jndi", args); try { Context context = getRemoteHostContext(hostURL); //Use JNDI lookup(), rather than the RMI version, //AND replace the Java remote interface cast with a call to javax.rmi.PortableRemoteObject.narrow(): if (this.isRMIOverIIOP()) { return new RMIRemoteConnection((RMIRemoteCommandConnection)PortableRemoteObject.narrow(context.lookup(remoteObjectIdentifier), RMIRemoteCommandConnection.class)); } else { return new RMIRemoteConnection((RMIRemoteCommandConnection)context.lookup(remoteObjectIdentifier)); } } catch (Exception e) { try { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(remoteObjectIdentifier, hostURL, e)); } catch (Exception ex2) { // Must catch this exception and log a debug message rcm.logDebug("unable_to_look_up_remote_conn_in_jndi", args); } } return null; }
/** * INTERNAL: * Look the specified remote object up in the RMIRegistry and return a Connection to it. */ protected RemoteConnection createConnectionFromRegistry(String remoteObjectIdentifier, String hostURL) { String formattedUrl = formatURLforRegistry(hostURL, remoteObjectIdentifier); Object[] args = { formattedUrl }; rcm.logDebug("looking_up_remote_conn_in_registry", args); try { return new RMIRemoteConnection((RMIRemoteCommandConnection)Naming.lookup(formattedUrl)); } catch (Exception e) { try { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(remoteObjectIdentifier, hostURL, e)); } catch (Exception ex2) { // Must catch this exception and log a debug message rcm.logDebug("unable_to_look_up_remote_conn_in_registry", args); } } return null; }
/** * INTERNAL: * Look the specified remote object up in the RMIRegistry and return a Connection to it. */ protected RemoteConnection createConnectionFromRegistry(String remoteObjectIdentifier, String hostURL) { String formattedUrl = formatURLforRegistry(hostURL, remoteObjectIdentifier); Object[] args = { formattedUrl }; rcm.logDebug("looking_up_remote_conn_in_registry", args); try { return new RMIRemoteConnection((RMIRemoteCommandConnection)Naming.lookup(formattedUrl)); } catch (Exception e) { try { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(remoteObjectIdentifier, hostURL, e)); } catch (Exception ex2) { // Must catch this exception and log a debug message rcm.logDebug("unable_to_look_up_remote_conn_in_registry", args); } } return null; }
/** * INTERNAL: * Look the specified remote object up in the RMIRegistry and return a Connection to it. */ protected RemoteConnection createConnectionFromRegistry(String remoteObjectIdentifier, String hostURL) { String formattedUrl = formatURLforRegistry(hostURL, remoteObjectIdentifier); Object[] args = { formattedUrl }; rcm.logDebug("looking_up_remote_conn_in_registry", args); try { return new RMIRemoteConnection((RMIRemoteCommandConnection)Naming.lookup(formattedUrl)); } catch (Exception e) { try { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(remoteObjectIdentifier, hostURL, e)); } catch (Exception ex2) { // Must catch this exception and log a debug message rcm.logDebug("unable_to_look_up_remote_conn_in_registry", args); } } return null; }
/** * INTERNAL: * Create and return a wrapper of a CORBA remote connection to the specified service */ public RemoteConnection createConnection(ServiceId connectionServiceId) { RemoteConnection connection = null; Object[] args = { connectionServiceId.getId(), connectionServiceId.getURL() }; rcm.logDebug("looking_up_remote_conn_in_jndi", args); try { Context context = getRemoteHostContext(connectionServiceId.getURL()); // look up the distributed connection from JNDI CORBAConnection connectionImpl = narrow((org.omg.CORBA.Object)context.lookup(connectionServiceId.getId())); // create the wrapper of the distributed connection connection = new CORBARemoteCommandConnection(connectionImpl); connection.setServiceId(connectionServiceId); } catch (Exception e) { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(connectionServiceId.getId(), connectionServiceId.getURL(), e)); } return connection; }
/** * INTERNAL: * Create and return a wrapper of a CORBA remote connection to the specified service */ public RemoteConnection createConnection(ServiceId connectionServiceId) { RemoteConnection connection = null; Object[] args = { connectionServiceId.getId(), connectionServiceId.getURL() }; rcm.logDebug("looking_up_remote_conn_in_jndi", args); try { Context context = getRemoteHostContext(connectionServiceId.getURL()); // look up the distributed connection from JNDI CORBAConnection connectionImpl = narrow((org.omg.CORBA.Object)context.lookup(connectionServiceId.getId())); // create the wrapper of the distributed connection connection = new CORBARemoteCommandConnection(connectionImpl); connection.setServiceId(connectionServiceId); } catch (Exception e) { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(connectionServiceId.getId(), connectionServiceId.getURL(), e)); } return connection; }
/** * INTERNAL: * Create and return a wrapper of a CORBA remote connection to the specified service */ @Override public RemoteConnection createConnection(ServiceId connectionServiceId) { RemoteConnection connection = null; Object[] args = { connectionServiceId.getId(), connectionServiceId.getURL() }; rcm.logDebug("looking_up_remote_conn_in_jndi", args); try { Context context = getRemoteHostContext(connectionServiceId.getURL()); // look up the distributed connection from JNDI CORBAConnection connectionImpl = narrow((org.omg.CORBA.Object)context.lookup(connectionServiceId.getId())); // create the wrapper of the distributed connection connection = new CORBARemoteCommandConnection(connectionImpl); connection.setServiceId(connectionServiceId); } catch (Exception e) { rcm.handleException(RemoteCommandManagerException.errorLookingUpRemoteConnection(connectionServiceId.getId(), connectionServiceId.getURL(), e)); } return connection; }