try {
remoteImage.createRenderableOp(id, operationName, newPB);
} catch(RemoteException e) {
String message = JaiI18N.getString("RMIServerProxy8");
listener.errorOccurred(message,
new RemoteImagingException(message, e),
this, false);
// throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
}
Object source;
int size = getNumSources();
for (int i=0; i < size; i++) {
Vector sources = paramBlock.getSources();
source = sources.elementAt(i);
if (source instanceof RMIServerProxy) {
try {
RMIServerProxy rop = (RMIServerProxy)source;
// Send the id of the source
if ((rop.serverName).equals(this.serverName)){
remoteImage.setRenderableSource(id, rop.getRMIID(), i);
} else {
remoteImage.setRenderableSource(id, rop.getRMIID(),
rop.serverName,
rop.operationName, i);
}
} catch (RemoteException e) {
String message = JaiI18N.getString("RMIServerProxy6");
listener.errorOccurred(message,
new RemoteImagingException(message, e),
this, false);
/*
throw new RemoteImagingException(
ImageUtil.getStackTraceString(e));
*/
}
} else
if (source instanceof RenderableOp) {
try {
remoteImage.setRenderableSource(id,
(RenderableOp)source,
i);
} catch(RemoteException e) {
String message = JaiI18N.getString("RMIServerProxy6");
listener.errorOccurred(message,
new RemoteImagingException(message, e),
this, false);
/*
throw new RemoteImagingException(
ImageUtil.getStackTraceString(e));
*/
}
}
else if (source instanceof RenderedImage) {
try {
remoteImage.setRenderableSource(
id,
new SerializableRenderedImage((RenderedImage)source),
i);
} catch(RemoteException e) {
String message = JaiI18N.getString("RMIServerProxy6");
listener.errorOccurred(message,
new RemoteImagingException(message, e),
this, false);
/*
throw new RemoteImagingException(
ImageUtil.getStackTraceString(e));
*/
}
}
}
try {
// Increment the reference count for this id on the server
remoteImage.incrementRefCount(id);
} catch (RemoteException e) {
String message = JaiI18N.getString("RMIServerProxy9");
listener.errorOccurred(message,
new RemoteImagingException(message, e),
this, false);
// throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
}
// If this was a call for Rendering of this RenderableOp
// then render it and store the associated id in
// renderingID and then RMICRIF will return a new RMISP with reference
// to that rendering ID
// This will not be executed at the time of calls to getBounds2D and
// mapRenderContext
if (isRender){
try {
renderingID =
remoteImage.getRendering(id,
SerializerFactory.getState(rc,
null));
// Increment the reference count for this id on the server
remoteImage.incrementRefCount(renderingID);
} catch (RemoteException e) {
String message = JaiI18N.getString("RMIServerProxy10");
listener.errorOccurred(message,
new RemoteImagingException(message, e),
this, false);
// throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
}
}
}