m.setXID(reqMsg.getXID());
m.setResult(StreamResultMessage.RESULT_WRITE_OK);
return m;
}
default:
throw new RemoteOSGiException(
"Unimplemented op code for stream request " + msg); //$NON-NLS-1$
}
} catch (final IOException e) {
final StreamResultMessage m = new StreamResultMessage();
m.setXID(reqMsg.getXID());
m.setResult(StreamResultMessage.RESULT_EXCEPTION);
m.setException(e);
return m;
}
}
case RemoteOSGiMessage.REQUEST_BUNDLE:
final RequestBundleMessage reqB = (RequestBundleMessage) msg;
try {
final String serviceID = reqB.getServiceID();
final RemoteServiceRegistration reg = getServiceRegistration(serviceID);
final byte[] bytes = RemoteOSGiServiceImpl.getBundle(reg
.getReference().getBundle());
final DeliverBundlesMessage delB = new DeliverBundlesMessage();
delB.setXID(reqB.getXID());
delB.setDependencies(new byte[][] { bytes });
return delB;
} catch (IOException ioe) {
ioe.printStackTrace();
return null;
}
case RemoteOSGiMessage.REQUEST_DEPENDENCIES:
final RequestDependenciesMessage reqDeps = (RequestDependenciesMessage) msg;
try {
final byte[][] bundleBytes = RemoteOSGiServiceImpl
.getBundlesForPackages(reqDeps.getPackages());
final DeliverBundlesMessage delDeps = new DeliverBundlesMessage();
delDeps.setXID(reqDeps.getXID());
delDeps.setDependencies(bundleBytes);
return delDeps;
} catch (IOException ioe) {
ioe.printStackTrace();
return null;
}
default:
throw new RemoteOSGiException("Unimplemented message " + msg); //$NON-NLS-1$
}
}