openamf/src/java/org/openamf/invoker ServiceInvoker.java,1.4,1.5 SLSBServiceInvoker.java,1.3,1.4 WebServiceInvoker.java,1.4,1.5 JMXServiceInvoker.java,1.4,1.5 JavaServiceInvoker.java,1.7,1.8 PageableResultSetServiceInvoker.java,1.1,1.2

[email protected]
Newsgroups gmane.comp.java.openamf.cvs
Message-ID <[email protected]>
Update of /cvsroot/openamf/openamf/src/java/org/openamf/invoker
In directory sc8-pr-cvs1:/tmp/cvs-serv11161/src/java/org/openamf/invoker

Modified Files:
	ServiceInvoker.java SLSBServiceInvoker.java 
	WebServiceInvoker.java JMXServiceInvoker.java 
	JavaServiceInvoker.java PageableResultSetServiceInvoker.java 
Log Message:
1) updated the DefaultGateway so that Invokers are completly pluggable
2) this will also enable lots of new features for the AdvancedGateway

Index: ServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/ServiceInvoker.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ServiceInvoker.java	25 Apr 2003 17:14:25 -0000	1.4
--- ServiceInvoker.java	30 Apr 2003 01:02:04 -0000	1.5
***************
*** 1,4 ****
--- 1,7 ----
  package org.openamf.invoker;
  
+ import java.lang.reflect.Constructor;
+ import java.lang.reflect.InvocationTargetException;
+ 
  import javax.servlet.ServletContext;
  
***************
*** 15,19 ****
  		ServiceRequest request,
  		ServletContext servletContext) {
! 			
  		this.request = request;
  		this.servletContext = servletContext;
--- 18,22 ----
  		ServiceRequest request,
  		ServletContext servletContext) {
! 
  		this.request = request;
  		this.servletContext = servletContext;
***************
*** 36,39 ****
--- 39,69 ----
  	public void setPersistantServiceObject(Object persistantServiceObject) {
  		this.persistantServiceObject = persistantServiceObject;
+ 	}
+ 
+ 	public abstract boolean supports(ServiceRequest request);
+ 
+ 	public static ServiceInvoker load(
+ 		String className,
+ 		ServiceRequest request,
+ 		ServletContext servletContext)
+ 		throws
+ 			ClassNotFoundException,
+ 			NoSuchMethodException,
+ 			InstantiationException,
+ 			IllegalAccessException,
+ 			InvocationTargetException {
+ 
+ 		ServiceInvoker serviceInvoker;
+ 		Class serviceInvokerClass =
+ 			Thread.currentThread().getContextClassLoader().loadClass(className);
+ 
+ 		Constructor constructor =
+ 			serviceInvokerClass.getConstructor(
+ 				new Class[] { ServiceRequest.class, ServletContext.class });
+ 
+ 		serviceInvoker =
+ 			(ServiceInvoker) constructor.newInstance(
+ 				new Object[] { request, servletContext });
+ 		return serviceInvoker;
  	}
  

Index: SLSBServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/SLSBServiceInvoker.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SLSBServiceInvoker.java	25 Apr 2003 17:14:25 -0000	1.3
--- SLSBServiceInvoker.java	30 Apr 2003 01:02:05 -0000	1.4
***************
*** 3,6 ****
--- 3,7 ----
  import java.lang.reflect.Method;
  
+ import javax.ejb.EJBHome;
  import javax.ejb.EJBObject;
  import javax.naming.InitialContext;
***************
*** 18,22 ****
  		ServiceRequest request,
  		ServletContext servletContex) {
! 			
  		super(request, servletContex);
  	}
--- 19,23 ----
  		ServiceRequest request,
  		ServletContext servletContex) {
! 
  		super(request, servletContex);
  	}
***************
*** 45,48 ****
--- 46,61 ----
  		return serviceResult;
  
+ 	}
+ 
+ 	public boolean supports(ServiceRequest request) {
+ 		boolean supports = false;
+ 		try {
+ 			supports =
+ 				((new InitialContext()).lookup(request.getServiceName())
+ 					instanceof EJBHome);
+ 		} catch (Exception e) {
+ 		}
+ 
+ 		return supports;
  	}
  

Index: WebServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/WebServiceInvoker.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** WebServiceInvoker.java	25 Apr 2003 22:43:49 -0000	1.4
--- WebServiceInvoker.java	30 Apr 2003 01:02:05 -0000	1.5
***************
*** 414,416 ****
--- 414,421 ----
  	}
  
+ 	public boolean supports(ServiceRequest request) {
+ 		return (
+ 			request.getServiceName().toLowerCase().lastIndexOf("wsdl") != -1);
+ 	}
+ 
  }

Index: JMXServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/JMXServiceInvoker.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** JMXServiceInvoker.java	28 Apr 2003 04:41:10 -0000	1.4
--- JMXServiceInvoker.java	30 Apr 2003 01:02:06 -0000	1.5
***************
*** 58,60 ****
--- 58,64 ----
  	}
  
+ 	public boolean supports(ServiceRequest request) {
+ 		return (request.getServiceName().lastIndexOf(":") != -1);
+ 	}
+ 
  }

Index: JavaServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/JavaServiceInvoker.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** JavaServiceInvoker.java	28 Apr 2003 06:00:22 -0000	1.7
--- JavaServiceInvoker.java	30 Apr 2003 01:02:06 -0000	1.8
***************
*** 216,218 ****
--- 216,232 ----
  		return bean;
  	}
+ 
+ 	public boolean supports(ServiceRequest request) {
+ 
+ 		boolean supports = false;
+ 
+ 		try {
+ 			Thread.currentThread().getContextClassLoader().loadClass(
+ 				request.getServiceName());
+ 			supports = true;
+ 		} catch (Exception e) {}
+ 		
+ 		return supports;
+ 	}
+ 
  }

Index: PageableResultSetServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/PageableResultSetServiceInvoker.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PageableResultSetServiceInvoker.java	28 Apr 2003 06:01:26 -0000	1.1
--- PageableResultSetServiceInvoker.java	30 Apr 2003 01:02:07 -0000	1.2
***************
*** 10,13 ****
--- 10,14 ----
  
  import org.openamf.ServiceRequest;
+ import org.openamf.recordset.ASRecordSet;
  
  /**
***************
*** 28,31 ****
--- 29,36 ----
  		// TODO Auto-generated method stub
  		return null;
+ 	}
+ 
+ 	public boolean supports(ServiceRequest request) {
+ 		return request.getServiceName().equals(ASRecordSet.SERVICE_NAME);
  	}
  




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.