-
1. Re: org.jboss.invocation.Invocation in Jboss 7
jaikiran Mar 26, 2013 6:46 AM (in response to jamesviet)Although a same named class exists in AS7, it's not meant as a copy of the earlier version. Why do you need that class?
-
2. Re: org.jboss.invocation.Invocation in Jboss 7
jamesviet Mar 26, 2013 12:34 PM (in response to jaikiran)Hi jaikiran,
In Jboss 5, I compile successfully with org.jboss.invocation.Invocation class.
But when I move to Jboss 7, I met compile failure.
Do you know the package contains this class?
Thanks,
-
3. Re: org.jboss.invocation.Invocation in Jboss 7
jaikiran Mar 26, 2013 10:27 PM (in response to jamesviet)Can you tell us how and why you are using that class? Like I said, the AS7 one isn't meant to be the same as the AS5 one and in fact, when I checked yesterday it didn't have public visibility. It's just that it's named the same.
-
4. Re: org.jboss.invocation.Invocation in Jboss 7
jamesviet Mar 27, 2013 12:52 AM (in response to jaikiran)Hi jaikiran,
Here is my class:
package test;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.InvocationKey;
import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy;
import org.jboss.proxy.Interceptor;
import org.jboss.util.id.ID;
public class ClientInterceptor extends Interceptor {
/**
*
*/
private static final long serialVersionUID = 1L;
private String cachedAddress;
public ClientInterceptor() {
super();
}
private synchronized String getClientIPAddress(Invocation invocation) {
if (cachedAddress == null) {
try {
// make sure we get the ip address to talk to the server
JRMPInvokerProxy proxy = (JRMPInvokerProxy) invocation.getInvocationContext().context.get(InvocationKey.INVOKER);
// something this is a name which is only known at the server
// side
String serverHostName = proxy.getServerHostName();
if (isServerSide()) {
cachedAddress = InetAddress.getLocalHost().getHostAddress();
} else {
cachedAddress = getAddressToReachServer(InetAddress.getByName(serverHostName)).getHostAddress();
}
} catch (Exception e) {
//
}
}
return cachedAddress;
}
}
I think it may be moved to another package.
-
5. Re: org.jboss.invocation.Invocation in Jboss 7
jaikiran Mar 26, 2013 11:57 PM (in response to jamesviet)That interceptor isn't going to work in AS7. AS7 is a completely different code base. I don't know where you are using that interceptor but it looks like you are looking for the server's address in that interceptor? What exactly are you doing in there and what do you need it for? Maybe we might have a different way of doing it in AS7 or maybe you won't need it in AS7.
-
6. Re: org.jboss.invocation.Invocation in Jboss 7
jamesviet Jul 25, 2013 5:43 AM (in response to jaikiran)Hi,
In JBoss 5, if you want to get information from client (ex: host ip, user name, pass word) in server, you must use JRMPInvokerProxy. JRMPInvokerProxy got from org.jboss.invocation.Invocation
Ex:
JRMPInvokerProxy proxy = (JRMPInvokerProxy) invocation.getInvocationContext().context.get(InvocationKey.INVOKER);
// something this is a name which is only known at the server side
String serverHostName = proxy.getServerHostName();
How about JBoss 7, do we have way to do that?
Thank very much.
-
7. Re: org.jboss.invocation.Invocation in Jboss 7
jamesviet Jul 25, 2013 1:27 PM (in response to jamesviet)Someone can help me?