I have a parameter called "server" in several methods:
public synchronized Client getClientByStreamId(String streamId, Server server) {
//some logic
}
public Client getClientByPublicSID(String publicSID, boolean isAVClient, Server server) {
//some logic
}
What I want is that everytime those methods are called there is a check, that is performed to the param server before the method is called:
if (server == null) {
server = someServer; //someServer is a variable I get somewhere else
}
From what I know there must be some trick with an annotation in Java6 so that you can do something like (pseudo code):
@ManipulateArgs(MyMethod);
public synchronized Client getClientByStreamId(String streamId, Server server) {
//some logic
}
@ManipulateArgs(MyMethod);
public Client getClientByPublicSID(String publicSID, boolean isAVClient, Server server) {
//some logic
}
private MyMethod(Server server) {
if (server == null) {
server = someServer; //someServer is a variable I get somewhere else
}
}
Some kind of "pre-processor" that is called before the actual method is invoked with the params. I just can't remember what the name of this pre-processing was. Or if it was annotaction based or something else. But I think it was an annotation.
Thanks
Sebastian