Call Remote EJB method

วันนี้มานำเสนอ method การ get EJB Remote Instance กัน

	public static Object getEJBInstance(Class remoteKlazz){
		Object o = null;
		try {
			Context context = new InitialContext();
			Object callerObj = context.lookup(remoteKlazz.getName());
			o = javax.rmi.PortableRemoteObject.narrow(callerObj, remoteKlazz);
		} catch (NamingException e) {
		return o;

About WK

Kajook is a Senior Software Engineer. Job is Design & Develop in Java EE environment on Glassfish. I'm Interested in Agile software development ,iOS and Android.
This entry was posted in knowledge and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s