public Object run() { return stubStrategy.readRetval(finalIn); } });
return new StubStrategy(paramTypes, excepIds, excepTypes, retvalType, cl);
/** * Marshals into an output stream an exception thrown by the method. * * @param out a CDR output stream * @param e the exception to be written. */ public void writeException(OutputStream out, Throwable e) { int len = excepWriters.length; for (int i = 0; i < len; i++) { if (excepWriters[i].getExceptionClass().isInstance(e)) { excepWriters[i].write(out, e); return; } } throw new UnknownException(e); }
public SkeletonStrategy(final Method m) { // Keep the method this.m = m; // Initialize paramReaders Class[] paramTypes = m.getParameterTypes(); int len = paramTypes.length; paramReaders = new CDRStreamReader[len]; for (int i = 0; i < len; i++) { paramReaders[i] = CDRStream.readerFor(paramTypes[i]); } // Initialize excepWriters Class[] excepTypes = m.getExceptionTypes(); len = excepTypes.length; int n = 0; for (int i = 0; i < len; i++) { if (!RemoteException.class.isAssignableFrom(excepTypes[i])) { n++; } } excepWriters = new ExceptionWriter[n]; int j = 0; for (int i = 0; i < len; i++) { if (!RemoteException.class.isAssignableFrom(excepTypes[i])) { excepWriters[j++] = new ExceptionWriter(excepTypes[i]); } } ExceptionWriter.arraysort(excepWriters); // Initialize retvalWriter retvalWriter = CDRStream.writerFor(m.getReturnType()); }
exceptionList.add(clz); ExceptionReader exceptionReader = new ExceptionReader(clz, excepIds[i]); exceptionMap.put(exceptionReader.getReposId(), exceptionReader); } catch (ClassNotFoundException e) { throw IIOPLogger.ROOT_LOGGER.errorLoadingClass(excepTypes[i], e);
final Object[] params = op.readParams((org.omg.CORBA_2_3.portable.InputStream) in); if (op.isNonVoid()) { op.writeRetval(out, retVal); out = (org.omg.CORBA_2_3.portable.OutputStream) handler.createExceptionReply(); op.writeException(out, e);
/** * Unmarshals from an input stream an exception thrown by the method. * * @param id the repository id of the exception to unmarshal * @param in a CDR input stream * @return an exception unmarshaled from the stream. */ public Exception readException(String id, InputStream in) { ExceptionReader exceptionReader = (ExceptionReader) exceptionMap.get(id); if (exceptionReader == null) { return new UnexpectedException(id); } else { return exceptionReader.read(in); } }
OutputStream out = (OutputStream) _request(operationName, true); stubStrategy.writeParams(out, params); tracef("sent request: %s", operationName); in = (InputStream) _invoke(out); if (stubStrategy.isNonVoid()) { trace("received reply"); final InputStream finalIn = in;
public Exception run() { return stubStrategy.readException(ex.getId(), finalIn1); } });
private void prepareInterceptorContext(final SkeletonStrategy op, final Object[] params, final InterceptorContext interceptorContext) throws IOException, ClassNotFoundException { if (!home) { if (componentView.getComponent() instanceof StatefulSessionComponent) { final SessionID sessionID = (SessionID) unmarshalIdentifier(); interceptorContext.putPrivateData(SessionID.class, sessionID); } } interceptorContext.setContextData(new HashMap<>()); interceptorContext.setParameters(params); interceptorContext.setMethod(op.getMethod()); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, componentView.getComponent()); interceptorContext.putPrivateData(InvocationType.class, InvocationType.REMOTE); interceptorContext.setTransaction(inboundTxCurrent == null ? null : inboundTxCurrent.getCurrentTransaction()); }
beanMethodMap.put(op.getIDLName(), new SkeletonStrategy(method)); final OperationAnalysis setop = remoteAttrs[i].getMutatorAnalysis(); if (setop != null) { beanMethodMap.put(setop.getIDLName(), new SkeletonStrategy(realSetmethod)); for (int i = 0; i < ops.length; i++) { EjbLogger.DEPLOYMENT_LOGGER.debugf(" %s%n %s", ops[i].getJavaName(), ops[i].getIDLName()); beanMethodMap.put(ops[i].getIDLName(), new SkeletonStrategy(translateMethod(deploymentReflectionIndex, ops[i]))); if (op != null) { EjbLogger.DEPLOYMENT_LOGGER.debugf(" %s%n %s", op.getJavaName(), op.getIDLName()); homeMethodMap.put(op.getIDLName(), new SkeletonStrategy(translateMethod(deploymentReflectionIndex, op))); final OperationAnalysis setop = attrs[i].getMutatorAnalysis(); if (setop != null) { EjbLogger.DEPLOYMENT_LOGGER.debugf(" %s%n %s", setop.getJavaName(), setop.getIDLName()); homeMethodMap.put(setop.getIDLName(), new SkeletonStrategy(translateMethod(deploymentReflectionIndex, setop))); for (int i = 0; i < homeops.length; i++) { EjbLogger.DEPLOYMENT_LOGGER.debugf(" %s%n %s", homeops[i].getJavaName(), homeops[i].getIDLName()); homeMethodMap.put(homeops[i].getIDLName(), new SkeletonStrategy(translateMethod(deploymentReflectionIndex, homeops[i])));
/** * Marshals into an output stream an exception thrown by the method. * * @param out a CDR output stream * @param e the exception to be written. */ public void writeException(OutputStream out, Throwable e) { int len = excepWriters.length; for (int i = 0; i < len; i++) { if (excepWriters[i].getExceptionClass().isInstance(e)) { excepWriters[i].write(out, e); return; } } throw new UnknownException(e); }
public SkeletonStrategy(final Method m) { // Keep the method this.m = m; // Initialize paramReaders Class[] paramTypes = m.getParameterTypes(); int len = paramTypes.length; paramReaders = new CDRStreamReader[len]; for (int i = 0; i < len; i++) { paramReaders[i] = CDRStream.readerFor(paramTypes[i]); } // Initialize excepWriters Class[] excepTypes = m.getExceptionTypes(); len = excepTypes.length; int n = 0; for (int i = 0; i < len; i++) { if (!RemoteException.class.isAssignableFrom(excepTypes[i])) { n++; } } excepWriters = new ExceptionWriter[n]; int j = 0; for (int i = 0; i < len; i++) { if (!RemoteException.class.isAssignableFrom(excepTypes[i])) { excepWriters[j++] = new ExceptionWriter(excepTypes[i]); } } ExceptionWriter.arraysort(excepWriters); // Initialize retvalWriter retvalWriter = CDRStream.writerFor(m.getReturnType()); }
exceptionList.add(clz); ExceptionReader exceptionReader = new ExceptionReader(clz, excepIds[i]); exceptionMap.put(exceptionReader.getReposId(), exceptionReader); } catch (ClassNotFoundException e) { throw IIOPLogger.ROOT_LOGGER.errorLoadingClass(excepTypes[i], e);
return new StubStrategy(paramTypes, excepIds, excepTypes, retvalType, cl);
/** * Unmarshals from an input stream an exception thrown by the method. * * @param id the repository id of the exception to unmarshal * @param in a CDR input stream * @return an exception unmarshaled from the stream. */ public Exception readException(String id, InputStream in) { ExceptionReader exceptionReader = (ExceptionReader) exceptionMap.get(id); if (exceptionReader == null) { return new UnexpectedException(id); } else { return exceptionReader.read(in); } }
/** * Marshals into an output stream an exception thrown by the method. * * @param out a CDR output stream * @param e the exception to be written. */ public void writeException(OutputStream out, Throwable e) { int len = excepWriters.length; for (int i = 0; i < len; i++) { if (excepWriters[i].getExceptionClass().isInstance(e)) { excepWriters[i].write(out, e); return; } } throw new UnknownException(e); }
public SkeletonStrategy(final Method m) { // Keep the method this.m = m; // Initialize paramReaders Class[] paramTypes = m.getParameterTypes(); int len = paramTypes.length; paramReaders = new CDRStreamReader[len]; for (int i = 0; i < len; i++) { paramReaders[i] = CDRStream.readerFor(paramTypes[i]); } // Initialize excepWriters Class[] excepTypes = m.getExceptionTypes(); len = excepTypes.length; int n = 0; for (int i = 0; i < len; i++) { if (!RemoteException.class.isAssignableFrom(excepTypes[i])) { n++; } } excepWriters = new ExceptionWriter[n]; int j = 0; for (int i = 0; i < len; i++) { if (!RemoteException.class.isAssignableFrom(excepTypes[i])) { excepWriters[j++] = new ExceptionWriter(excepTypes[i]); } } ExceptionWriter.arraysort(excepWriters); // Initialize retvalWriter retvalWriter = CDRStream.writerFor(m.getReturnType()); }
return new StubStrategy(paramTypes, excepIds, excepTypes, retvalType, cl);
/** * Unmarshals from an input stream an exception thrown by the method. * * @param id the repository id of the exception to unmarshal * @param in a CDR input stream * @return an exception unmarshaled from the stream. */ public Exception readException(String id, InputStream in) { ExceptionReader exceptionReader = (ExceptionReader) exceptionMap.get(id); if (exceptionReader == null) { return new UnexpectedException(id); } else { return exceptionReader.read(in); } }