<condition property="do.depend.true">
<istrue value="${do.depend}"/>
</condition>
- <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
+ <condition property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
<and>
<isset property="jaxws.endorsed.dir"/>
<available file="nbproject/jaxws-build.xml"/>
<attribute default="" name="sourcepath"/>
<element name="customize" optional="true"/>
<sequential>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" sourcepath="@{sourcepath}" srcdir="@{srcdir}">
<classpath>
<path path="@{classpath}"/>
</classpath>
<contains string="${version-output}" substring="java version "1.3"/>
</or>
</condition>
- <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+ <condition property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
<istrue value="${have-jdk-older-than-1.4}"/>
</condition>
</target>
-->
<target depends="init" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
- <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+ <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
javac.classpath=\
${reference.jobid-api-java.jar}
# Space-separated list of extra javac options
-javac.compilerargs=-Xlint:unchecked
+javac.compilerargs=
javac.deprecation=false
-javac.source=1.5
-javac.target=1.5
+javac.source=
+javac.target=
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
source.encoding=UTF-8
src.dir=src
test.src.dir=test
+javac.compilerargs.jaxws=
* @throws IllegalArgumentException if wrong source type is set
*/
private String recognizeSource(Sources sourceEnum) {
- switch (sourceEnum) {
- case EDG_WLL_SOURCE_NONE: return "Undefined";
- case EDG_WLL_SOURCE_USER_INTERFACE: return "UserInterface";
- case EDG_WLL_SOURCE_NETWORK_SERVER: return "NetworkServer";
- case EDG_WLL_SOURCE_WORKLOAD_MANAGER: return "WorkloadManager";
- case EDG_WLL_SOURCE_BIG_HELPER: return "BigHelper";
- case EDG_WLL_SOURCE_JOB_SUBMISSION: return "JobController";
- case EDG_WLL_SOURCE_LOG_MONITOR: return "LogMonitor";
- case EDG_WLL_SOURCE_LRMS: return "LRMS";
- case EDG_WLL_SOURCE_APPLICATION: return "Application";
- case EDG_WLL_SOURCE_LB_SERVER: return "LBServer";
+ switch (sourceEnum.source) {
+ case Sources.EDG_WLL_SOURCE_NONE: return "Undefined";
+ case Sources.EDG_WLL_SOURCE_USER_INTERFACE: return "UserInterface";
+ case Sources.EDG_WLL_SOURCE_NETWORK_SERVER: return "NetworkServer";
+ case Sources.EDG_WLL_SOURCE_WORKLOAD_MANAGER: return "WorkloadManager";
+ case Sources.EDG_WLL_SOURCE_BIG_HELPER: return "BigHelper";
+ case Sources.EDG_WLL_SOURCE_JOB_SUBMISSION: return "JobController";
+ case Sources.EDG_WLL_SOURCE_LOG_MONITOR: return "LogMonitor";
+ case Sources.EDG_WLL_SOURCE_LRMS: return "LRMS";
+ case Sources.EDG_WLL_SOURCE_APPLICATION: return "Application";
+ case Sources.EDG_WLL_SOURCE_LB_SERVER: return "LBServer";
default: throw new IllegalArgumentException("wrong source type");
}
}
private int repeatWriteToFile = 5;
private int connAttempts = 3;
private int timeout = 3;
- private Boolean useUnixSocket = true;
+ private Boolean useUnixSocket = Boolean.TRUE;
//tutorial http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
//native method which is written in C and imported to Java
if (!file.exists()) {
continue;
}
- fileLength = raf.length();
+ fileLength = new Long(raf.length());
fileWriter = new FileWriter(file, true);
//true means append data at the end of file
long fileSize,
String message) {
- if (useUnixSocket) {
+ if (useUnixSocket.booleanValue()) {
try {
System.loadLibrary("sendviasocket");
message += '\n';
timeout);
} catch (UnsatisfiedLinkError ex) {
- useUnixSocket = false;
+ useUnixSocket = Boolean.FALSE;
System.err.println(ex);
}
}
* @param event event
* @throws java.lang.IllegalArgumentException if event, prefix or path
*/
- @Override
public void log(Event event) {
if (event == null) {
throw new IllegalArgumentException("ContextIL event");
if (pathToSocket == null || pathToSocket.equals("")) {
pathToSocket = new String("");
- useUnixSocket = false;
+ useUnixSocket = Boolean.FALSE;
}
if (pathToNativeLib == null || pathToNativeLib.equals("")) {
pathToNativeLib = new String("");
- useUnixSocket = false;
+ useUnixSocket = Boolean.FALSE;
}
super.log(event);
Long fileLength = writeToFile(prefix, message);
- writeToSocket(pathToSocket, fileLength, message);
+ writeToSocket(pathToSocket, fileLength.longValue(), message);
}
/**
if (!file.exists()) {
continue;
}
- fileLength = raf.length();
+ fileLength = new Long(raf.length());
fileWriter = new FileWriter(file, true);
//true means append data to the end of file
socket.setEnabledProtocols(new String[]{"SSLv3"}); // SSLv2Hello, SSLv3,TLSv1
//enable only ciphers without RC4 (some bug in JSSE?)
String[] ciphers = socket.getEnabledCipherSuites();
- ArrayList<String> al = new ArrayList<String>(ciphers.length);
+// ArrayList<String> al = new ArrayList<String>(ciphers.length);
+ ArrayList al = new ArrayList(ciphers.length);
for (int i = 0; i < ciphers.length; i++) {
if (ciphers[i].indexOf("RC4") == -1) al.add(ciphers[i]);
}
}
}
- @Override
public void log(Event event) {
if (event == null) {
throw new IllegalArgumentException("ContextProxy event");
* @param part part of sequence number which will be increased
*/
public void incrementSeqCode(Sources part) {
- seqCode[part.ordinal()-1]++;
+ seqCode[part.source-1]++;
}
/**
} else {
colonPosition = seqCodeString.indexOf(':', currentPosition);
}
- seqCode[i] = new Integer(seqCodeString.substring(equalsPosition+1, colonPosition));
+ seqCode[i] = (new Integer(seqCodeString.substring(equalsPosition+1, colonPosition))).intValue();
currentPosition = colonPosition + 1;
}
}
- @Override
public String toString() {
String tmp = Integer.toString(seqCode[0]);
String output = "UI=";
*
* @author Pavel Piskac (173297@mail.muni.cz)
*/
-public enum Sources {
- EDG_WLL_SOURCE_NONE, /* uninitialized value */
- EDG_WLL_SOURCE_USER_INTERFACE,
- EDG_WLL_SOURCE_NETWORK_SERVER,
- EDG_WLL_SOURCE_WORKLOAD_MANAGER,
- EDG_WLL_SOURCE_BIG_HELPER,
- EDG_WLL_SOURCE_JOB_SUBMISSION,
- EDG_WLL_SOURCE_LOG_MONITOR,
- EDG_WLL_SOURCE_LRMS,
- EDG_WLL_SOURCE_APPLICATION,
- EDG_WLL_SOURCE_LB_SERVER
+public class Sources {
+ public static final int EDG_WLL_SOURCE_NONE = 0; /* uninitialized value */
+ public static final int EDG_WLL_SOURCE_USER_INTERFACE = 1;
+ public static final int EDG_WLL_SOURCE_NETWORK_SERVER = 2;
+ public static final int EDG_WLL_SOURCE_WORKLOAD_MANAGER = 3;
+ public static final int EDG_WLL_SOURCE_BIG_HELPER = 4;
+ public static final int EDG_WLL_SOURCE_JOB_SUBMISSION = 5;
+ public static final int EDG_WLL_SOURCE_LOG_MONITOR = 6;
+ public static final int EDG_WLL_SOURCE_LRMS = 7;
+ public static final int EDG_WLL_SOURCE_APPLICATION = 8;
+ public static final int EDG_WLL_SOURCE_LB_SERVER = 9;
+
+ public int source;
+
+ public Sources() {
+ this.source = 0;
+ }
+
+ public Sources(int source) {
+ this.source = source;
+ }
}
* In this case we have to use method which converts args[2] to Sources. In real environment it will
* not be used.
*/
- ctx.setSource(stringToSources(args[2]));
+ ctx.setSource(new Sources(stringToSources(args[2])));
/* Flag tells which part of the sequence number will be increased. It is a number in range from 0 to 8
* Example: ctx.setFlag(0);
*/
- ctx.setFlag(new Integer(args[3]));
+ ctx.setFlag((new Integer(args[3])).intValue());
/* Name of the computer where is locallogger running
* Example: ctx.setHost("pelargir.ics.muni.cz");
* This method helps with converting String from input to convert to Source.
* In real environment it will not be used.
*/
- private static Sources stringToSources(String source) {
+ private static int stringToSources(String source) {
if (source.equals("Sources.EDG_WLL_SOURCE_NONE")) return Sources.EDG_WLL_SOURCE_NONE;
if (source.equals("Sources.EDG_WLL_SOURCE_USER_INTERFACE")) return Sources.EDG_WLL_SOURCE_USER_INTERFACE;
if (source.equals("Sources.EDG_WLL_SOURCE_NETWORK_SERVER")) return Sources.EDG_WLL_SOURCE_NETWORK_SERVER;
if (source.equals("Sources.EDG_WLL_SOURCE_APPLICATION")) return Sources.EDG_WLL_SOURCE_APPLICATION;
if (source.equals("Sources.EDG_WLL_SOURCE_LB_SERVER")) return Sources.EDG_WLL_SOURCE_LB_SERVER;
throw new IllegalArgumentException("wrong source type");
-
}
}