Merge branch 'master' of ssh://git.code.sf.net/p/hl7api/fhircode

Conflicts:
	hapi-fhir-base/pom.xml
This commit is contained in:
jamesagnew 2014-02-27 13:23:35 -05:00
commit 14b795ad68
3 changed files with 40 additions and 3 deletions

View File

@ -64,6 +64,16 @@
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- Testing -->
<dependency>
@ -97,6 +107,33 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.1.1.v20140108</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.1.1.v20140108</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>directory-naming</groupId>
<artifactId>naming-java</artifactId>
<version>0.8</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@ -36,8 +36,8 @@ public class ResourceMethod {
this.resourceType = resourceType;
}
public IResource getResourceType() throws IllegalAccessException, InstantiationException {
return (IResource)resourceType.newInstance();
public Class getResourceType() throws IllegalAccessException, InstantiationException {
return resourceType.getClass();
}
public RequestType getRequestType() {

View File

@ -171,7 +171,7 @@ public class Service extends HttpServlet {
ResourceMethod resourceMethod = resource.getMethod(params.keySet());
if (null == resourceMethod) throw new MethodNotFoundException("No resource method available for the supplied parameters " + params);
FhirContext ctx = new FhirContext(resourceMethod.getResourceType().getClass());
FhirContext ctx = new FhirContext(resourceMethod.getResourceType());
XmlParser p = new XmlParser(ctx);
response.getWriter().write(p.encodeResourceToString(resourceMethod.invoke(params)));
} catch (Throwable t) {