Skip to content
Snippets Groups Projects
Commit 94514525 authored by Florian Fittkau's avatar Florian Fittkau
Browse files

init

parents
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/explorviz-monitoring.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/bin
/build
/dist
/reports
/xtend-gen
Thumbs.db
*.trace
\ No newline at end of file
.project 0 → 100644
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LightRPCApplication</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/LightRPCApplication/src/explorviz/lightrpc/LightRPCMainStarter.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="explorviz.lightrpc.LightRPCMainStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="LightRPCApplication"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1G"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8"?>
<project name="Common" default="build-all" basedir=".">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="jar.dir" value="dist"/>
<property name="test.reports" value="reports"/>
<property name="test.src" value="test"/>
<!-- MAIN JOBS -->
<target name="build-all" depends="clean,jar,test" description="Compiles and packages the Common Jar">
</target>
<target name="clean" description="Removes artifacts from previous builds">
<delete dir="${build.dir}" includeemptydirs="true" />
<delete dir="${jar.dir}" includeemptydirs="true" />
<delete dir="${reports.dir}" includeemptydirs="true" />
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/explorviz-common.jar">
<manifest>
<attribute name="Class-Path" value="."/>
<attribute name="Can-Redefine-Classes" value="true"/>
</manifest>
<fileset dir="${build.dir}"/>
<fileset dir="." includes="*LICENSE*" />
<zipfileset excludes="META-INF/*.SF" src="lib/slf4j-simple-1.7.5.jar"/>
</jar>
</target>
<target name="compile">
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath" includeantruntime="false" debug="true" />
</target>
<path id="classpath">
<fileset dir=".">
<include name="lib/*.jar"/>
</fileset>
</path>
<!-- TEST JOBS -->
<target name="test" depends="compile-tests" description="JUnit-Tests">
<mkdir dir="${test.reports}" />
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="testclasspath"/>
</classpath>
<formatter type="xml" />
<batchtest todir="${test.reports}">
<fileset dir="${test.src}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="compile-tests" depends="compile">
<mkdir dir="${build.dir}"/>
<javac srcdir="${test.src}" destdir="${build.dir}" includeantruntime="false" debug="true">
<classpath>
<path refid="testclasspath"/>
</classpath>
</javac>
</target>
<path id="testclasspath">
<pathelement path="${build.dir}" />
<fileset dir="lib" includes="*.jar" />
</path>
</project>
\ No newline at end of file
File added
File added
File added
package explorviz.lightrpc;
import explorviz.lightrpc.jaxws.JAXWSClient;
import explorviz.lightrpc.jaxws.JAXWSServer;
import explorviz.live_trace_processing.main.MonitoringController;
public class LightRPCMainStarter {
public static void main(String[] args) {
MonitoringController.setMonitoringEnabled(true);
JAXWSServer.startServer(9999);
JAXWSClient.accessServer(9999);
try {
Thread.sleep(10000);
} catch (final InterruptedException e) {
}
JAXWSServer.endServer();
MonitoringController.shutdown();
}
}
package explorviz.lightrpc.jaxws;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
public class JAXWSClient {
public static void accessServer(int port) {
try {
final URL url = new URL("http://localhost:" + port + "/ws/lightrpc?wsdl");
final QName qname = new QName("http://jaxws.lightrpc.explorviz/",
"LightServiceEndpointImplService");
final Service service = Service.create(url, qname);
final LightServiceEndpoint rpcService = service.getPort(LightServiceEndpoint.class);
System.out.println(rpcService.rpcCall());
} catch (final MalformedURLException e) {
}
}
}
package explorviz.lightrpc.jaxws;
import javax.xml.ws.Endpoint;
public class JAXWSServer {
private static Endpoint endpoint;
public static void startServer(int port) {
endpoint = Endpoint.publish("http://localhost:" + port + "/ws/lightrpc",
new LightServiceEndpointImpl());
}
public static void endServer() {
if (endpoint != null && endpoint.isPublished()) {
endpoint.stop();
}
}
}
package explorviz.lightrpc.jaxws;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface LightServiceEndpoint {
@WebMethod
String rpcCall();
}
package explorviz.lightrpc.jaxws;
import javax.jws.WebService;
@WebService(endpointInterface = "explorviz.lightrpc.jaxws.LightServiceEndpoint")
public class LightServiceEndpointImpl implements LightServiceEndpoint {
@Override
public String rpcCall() {
return "result";
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment