HPOSSOD 1.0 Technical Note
HP Web Services for Output Server 58
Using HP Web Services for Output Server
JBoss clustering with Apache load balancer
private byte[] getMD5(String filepath)throws Exception{
FileInputStream fis = new FileInputStream(filepath);
MessageDigest md1 = MessageDigest.getInstance("SHA");
DigestInputStream dis = new DigestInputStream(fis, md1);
dis.on(true);
int bytRead=0;
int buffer=1000;
byte[] b=new byte[buffer];
while((bytRead=dis.read(b))>0){}
byte bt[]=md1.digest();
return bt;
}
private String convertToHex(byte[] data) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < data.length; i++) {
int halfbyte = (data[i] >>> 4) & 0x0F;
int two_halfs = 0;
do {
if ((0 <= halfbyte) && (halfbyte <= 9))
buf.append((char) ('0' + halfbyte));
else
buf.append((char) ('a' + (halfbyte - 10)));
halfbyte = data[i] & 0x0F;
} while (two_halfs++ < 1);
}
return buf.toString();
}
private boolean HasMoreChunksExists(String queryResponse)throws Exception{
Parser parser=new Parser(queryResponse);
AttributeSet aset=parser.parseDocument("operation-attributes");
String hasMoreChunksValue=aset.getValue("has-more-chunks");
if("true".equalsIgnoreCase(hasMoreChunksValue)) return true;
return false;
}
private void setSesssionMaintain(Boolean session){
map.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,session);
}
}
JBoss clustering with Apache load balancer
To perform JBoss clustering with Apache load balancer, follow these steps:
1. Download the latest Apache2 package from http://httpd.apache.org/download.cgi
and install it.
2. Download the latest available package from mod_jk 1.2.x from
http://httpd.apache.org/download.cgi. Rename the lib mod_jk.so and copy it to
APACHE_HOME/modules directory.
3. Add the following line to the APACHE_HOME/conf/httpd.conf directory: