Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. SERVER:
  2. static {
  3. try {
  4. MARSHALLER_FACTORY = Marshalling.getMarshallerFactory("river", Module.getModuleFromDefaultLoader(ModuleIdentifier.fromString("org.jboss.marshalling.river")).getClassLoader());
  5. } catch (ModuleLoadException e) {
  6. throw new RuntimeException(e);
  7. }
  8. CONFIG = new MarshallingConfiguration();
  9. CONFIG.setVersion(2);
  10. try {
  11. CONFIG.setClassResolver(new SimpleClassResolver(Module.getModuleFromCurrentLoader(module).getClassLoader()));
  12. } catch(Exception e) {
  13. throw new RuntimeException(e);
  14. }
  15. }
  16.  
  17. CLIENT:
  18.  
  19. static {
  20. MARSHALLER_FACTORY = Marshalling.getMarshallerFactory("river");
  21. CONFIG = new MarshallingConfiguration();
  22. CONFIG.setVersion(2);
  23. CONFIG.setClassResolver(new SimpleClassResolver(ProtocolUtils.class.getClassLoader()));
  24. }
  25.  
  26. private ProtocolUtils() {
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement