public static void main(String[] args) throws Exception { Remoteserver objremoteserver=new Remoteserver(); objremoteserver.setmsg("Hello! How are you?"); System.out.println(objremoteserver.getmsg()); try { Naming.rebind("Remotemethod", objremoteserver); System.out.println("Server Started"); } catch(RemoteException re) { System.out.println(re.getLocalizedMessage()); } finally { System.out.println("Unknown Exception Occured!!!!"); } }
public MsgBoxWsaResponsesCorrelator(String msgBoxServiceLoc,AsynchronousInvoker output) throws DynamicInfosetProcessorException { this.invoker = output; this.msgBoxServiceLoc = msgBoxServiceLoc; msgBoxClient = new MsgBoxClient(); try { msgBoxAddr = msgBoxClient.createMessageBox(msgBoxServiceLoc,5000L); try { setReplyTo(new WsaEndpointReference(new URI(msgBoxAddr.getAddress()))); } catch (URISyntaxException e) { logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates. } messageBoxDonwloader = new Thread(this, Thread.currentThread().getName()+"-async-msgbox-correlator"); messageBoxDonwloader.setDaemon(true); messageBoxDonwloader.start(); } catch (RemoteException e) { logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates. } }
public MsgBoxWsaResponsesCorrelator(String msgBoxServiceLoc,AsynchronousInvoker output) throws DynamicInfosetProcessorException { this.invoker = output; this.msgBoxServiceLoc = msgBoxServiceLoc; msgBoxClient = new MsgBoxClient(); try { msgBoxAddr = msgBoxClient.createMessageBox(msgBoxServiceLoc,5000L); try { setReplyTo(new WsaEndpointReference(new URI(msgBoxAddr.getAddress()))); } catch (URISyntaxException e) { logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates. } messageBoxDonwloader = new Thread(this, Thread.currentThread().getName()+"-async-msgbox-correlator"); messageBoxDonwloader.setDaemon(true); messageBoxDonwloader.start(); } catch (RemoteException e) { logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates. } }
throw new ConfigurationException(e.getLocalizedMessage(), e); } catch (RemoteException e) { LOG.error(e.getLocalizedMessage()); throw new InvokerException(e.getLocalizedMessage(), e); } catch (Throwable e) { LOG.error(e.getLocalizedMessage());
/** * Sent/send this return string. * @param out The return output stream. * @param strReturn The string to return. */ public void setErrorReturn(PrintWriter out, RemoteException ex) throws RemoteException { out.println(Utility.startTag(XMLTags.STATUS_TEXT)); String strMessage = ex.getLocalizedMessage(); if (Utility.isNumeric(strMessage)) { try { int iErrorCode = Integer.parseInt(strMessage); out.println(Utility.startTag(XMLTags.ERROR_CODE) + strMessage + Utility.endTag(XMLTags.ERROR_CODE)); if (this.getTask() != null) if (this.getTask().getApplication() != null) strMessage = this.getTask().getApplication().getSecurityErrorText(iErrorCode); } catch (NumberFormatException ex2) { // Ignore } } out.println(Utility.startTag(XMLTags.TEXT) + strMessage + Utility.endTag(XMLTags.TEXT)); out.println(Utility.startTag(XMLTags.ERROR) + "error" + Utility.endTag(XMLTags.ERROR)); out.println(Utility.endTag(XMLTags.STATUS_TEXT)); return; } /**
public void authenticate(String userID, String psswrd) throws AuthenticationException { // May be null String realmName = (String) env.get("openejb.authentication.realmName"); AuthenticationRequest req = new AuthenticationRequest(realmName, userID, psswrd); AuthenticationResponse res = null; try { res = requestAuthorization(req); } catch (RemoteException e) { throw new AuthenticationException(e.getLocalizedMessage()); } switch (res.getResponseCode()) { case ResponseCodes.AUTH_GRANTED: client = res.getIdentity(); break; case ResponseCodes.AUTH_REDIRECT: client = res.getIdentity(); server = res.getServer(); break; case ResponseCodes.AUTH_DENIED: throw (AuthenticationException) new AuthenticationException("This principle is not authorized.").initCause(res.getDeniedCause()); } }
public void authenticate(final String userID, final String psswrd, final boolean logout) throws AuthenticationException { final AuthenticationRequest req = new AuthenticationRequest(String.class.cast(env.get(AUTHENTICATION_REALM_NAME)), userID, psswrd, getTimeout(env)); if (logout) { req.setLogoutIdentity(null != client ? client.getClientIdentity() : null); } final AuthenticationResponse res; try { res = requestAuthorization(req); } catch (final RemoteException e) { throw new AuthenticationException(e.getLocalizedMessage()); } switch (res.getResponseCode()) { case ResponseCodes.AUTH_GRANTED: client = logout ? new ClientMetaData() : res.getIdentity(); break; case ResponseCodes.AUTH_REDIRECT: client = logout ? new ClientMetaData() : res.getIdentity(); server = res.getServer(); break; case ResponseCodes.AUTH_DENIED: throw (AuthenticationException) new AuthenticationException("This principle is not authorized.").initCause(res.getDeniedCause()); } seedClientSerializer(); }