-
1. Re: Errai marshalling - How to mark an property non portable?
mbarkley Feb 7, 2014 11:04 AM (in response to rathiandi)Hi Amit,
If you use the "transient" keyword on a field, the marshaller will not serialize it.
Cheers.
-
2. Re: Errai marshalling - How to mark an property non portable?
rathiandi Feb 7, 2014 7:50 PM (in response to mbarkley)Well, I think in that case JPA will start ignoring it too and I don't want it. I want JPA to respect that field but marshaller to ignore it to reduce serialization process and network load. You know what i mean.
Btw, is there a any direct (static method) to get hold of "org.jboss.errai.bus.client.api.messaging.RequestDispatcher" type instance as serverside. Like ErraiBus.getDispatcher() for server side (An alternative way to Injection code like below) :
private RequestDispatcher dispatcher;
@Inject public TuneDriveServiceImpl(RequestDispatcher dispatcher) {
this.dispatcher = dispatcher;
}
Kind Regards
Amit
-
3. Re: Errai marshalling - How to mark an property non portable?
mbarkley Feb 10, 2014 1:53 PM (in response to rathiandi)Hmm, unfortunately we don't have another way to prevent marshalling of a @Portable field. But here is a bit of work around that you could try that I think will work for you:
- Split your current class into two classes which I will call MarshallableParent, and its subclass MarshallableChild.
- Put all the fields you wish to transmitted over the wire in MarshallableParent.
- Put the fields you do not wish to transmit in MarshallableChild
- Mark MarshallableParent as @Portable
- Mark MarshallableChild as @Portable(aliasOf = MarshallableParent.class)
Now whenever you marshall the MarshallableChild class, it will use the bindings for MarshallableParent (meaning the fields only in MarshallableChild will not be transmitted).
I'm less familiar with JPA so hopefully this will work with that too. As for your other question, I'm not aware of any static way to access the dispatcher or bus from server-side code.
Cheers.
Edit: Fixed some typos that probably made this quite confusing.