This is an interesting question, but I doubt there is a solution to it. You might want to go one step back and post what you need to know this information for. If it is merely for logging and to check if calls are local or remote, you could just write an interceptor that logs the invocation type.
Well ! i am actually trying to simulate streaming behaviour in a session bean. As we know IO streams are not serilizable and hence can not be used in EJB method return types, I am trying to put together a generic framework which can simulate the streaming behaviour. I got pretty successful in it and got it to working. But the framework needs to identify the client type. If local, it directly returns the stream instance to client (since no serialization is done here, hence no issues), but if remote it returns the simulated stream instance to client which then retrieves data from actual underneath stream instance that resides on server. As of now, i am handling this with different create methods in local and remote home to know if the bean instance is serving a remote or local client.
But this is a redundant workaround. I would like to have some thing more concrete and generic.
If ur issue is performance than plz don't worry beacaz when u deploy ur client & server on same jvm & ur ejb component is worked as a local intefcae.Only difference is in cas eof remote it is used only pass by value but no stub skeleton created.it means it will behave like a local interface.If any confision than let me know
Performace is definitely one thing. But more than that, i am just curious to know if there is a straightforward way to getting to know the access type (local or remote) in the bean instance.