Custom Socket Factory in 5.0.28

2005-01-10 Thread James Richardson

Hi,

I'm playing around with P2PSockets and thought it might be fun to plug
into tomcat.

I've written a (very trivial) class to implement the ServerSocketFactory
interface, but I'm not too sure how to make the Connector use it.

I read of a Factory element that goes within a Context element, but
couldn't find any more about it.

If anybody could point me in the right direction, would be much
appreciative.

Thanks!

James


package com.db.es.jxta.tomcat.connector;

import org.apache.catalina.net.ServerSocketFactory;
import org.p2psockets.P2PServerSocket;
import org.p2psockets.P2PNetwork;

import java.net.ServerSocket;
import java.net.InetAddress;
import java.io.IOException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.KeyManagementException;
import java.security.cert.CertificateException;

/**
 * $Header$
 */
public class JxtaServerSocketFactory implements ServerSocketFactory {

  protected static boolean initialised = false;

  protected static synchronized void init() throws IOException {
if (!initialised) {
  try {
P2PNetwork.signin();
initialised = true;
  } catch (Exception e) {
throw new IOException(e.toString());
  }
}
  }

  public ServerSocket createSocket(int port) throws IOException,
KeyStoreException, NoSuchAlgorithmException, CertificateException,
UnrecoverableKeyException, KeyManagementException {
init();
return new P2PServerSocket(port);
  }

  public ServerSocket createSocket(int port, int backlog) throws
IOException, KeyStoreException, NoSuchAlgorithmException,
CertificateException, UnrecoverableKeyException, KeyManagementException {
init();
return new P2PServerSocket(port, backlog);
  }

  public ServerSocket createSocket(int port, int backlog, InetAddress
ifAddress) throws IOException, KeyStoreException,
NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException,
KeyManagementException {
init();
return new P2PServerSocket(port, backlog, ifAddress);
  }
}

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Restart-On-Failure for Tomcat?

2005-02-07 Thread James Richardson



> -Original Message-
> From: Trond G. Ziarkowski [mailto:[EMAIL PROTECTED]
> Sent: 07 February 2005 07:57
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Restart-On-Failure for Tomcat?
> 
> Hi!
> 
> Someone mentioned on this list a while ago that Java Service Wrapper is
> capable of doing this. Haven't tested it myself but you can check it out
> at http://wrapper.tanukisoftware.org/
> 
> Trond
> 

Alternatively, you might consider writing a persistent jini wrapper around
tomcat.

This would also allow you to autodiscover tomcat instances, and be alerted
on state changes etc.

It would be a bit of coding though

James
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Sniffing loaclhost traffic for HHTP headers

2005-02-21 Thread James Richardson
Depending on why you want to do this, you might find this useful:



Its normally commented out in the server.xml, simply uncomment to dump out
the requests.

Cheers

James



> -Original Message-
> From: Marco Mastrocinque [mailto:[EMAIL PROTECTED]
> Sent: 21 February 2005 10:09
> To: tomcat-user@jakarta.apache.org
> Subject: Sniffing loaclhost traffic for HHTP headers
> 
> Hi All,
>Just a 'silly question,' I downloaded a HTTP sniffing program
> because
> I want to get use to reading header information. I'm using Apache
Tomcat,
> on
> a localhost configuration for development purposes. The sniffing program
I
> downloaded from 'EffeTech,' in the FAQ section states, 'Due to the
> mechanism
> of Windows operating system, a sniffer can't capture local-to-local
> traffic.' Please note I found this out the hard way! The question I have
> is
> how do you do it?
> 
> Thanks Marco Mastrocinque.
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Load balancing SSL sessions

2005-02-23 Thread James Richardson
> > On Feb 22, 2005, at 10:24 PM, Kelly Vista wrote:
> >
> >> Hi -
> >>
> >> We are looking to deploy our app, running on Tomcat 5, soon and are
> >> exploring load balancing options.  We are looking at H/W and S/W
> >> solutions, and I was wondering if anyone had any past
> >> experience/advice they would like to share.
> >>
> >> Our deployment is as pretty run-of-the-mill as it gets: 2 machines,
> >> each running Tomcat.  We would like to avoid replicating state (since
> >> we have a lot of state in these apps, for reasons beyond  our current
> >> control).  Even in-memory session replication would not be option
> >> here, so we're punting on the Tomcat cluster solution.
> >

You could use Coherence*Web to cluster your session state, and a Foundry
switch to do the load balancing. It can do sticky load balancing, and if a
server fails then coherence will ensure that your other boxes still have
the session state. 

http://www.foundrynet.com/products/webswitches/serveriron/
http://www.tangosol.com/coherence-uses-a.jsp

Best Regards,

James


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



James Richardson is out of the office.

2005-03-10 Thread James Richardson
I will be Out of the Office
Start Date: 10/03/2005.
End Date: 14/03/2005.


I will respond to your message when I return.








--

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]