Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 32899 invoked from network); 10 Jan 2005 11:45:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Jan 2005 11:45:50 -0000 Received: (qmail 54888 invoked by uid 500); 10 Jan 2005 11:45:20 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 54521 invoked by uid 500); 10 Jan 2005 11:45:18 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 54496 invoked by uid 99); 10 Jan 2005 11:45:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from loninmrp0.uk.db.com (HELO loninmrp0.uk.db.com) (160.83.52.97) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 10 Jan 2005 03:45:16 -0800 Received: from sdbo1003.db.com by loninmrp0.uk.db.com id j0ABjCGD027056; Mon, 10 Jan 2005 11:45:13 GMT Subject: Custom Socket Factory in 5.0.28 Date: Mon, 10 Jan 2005 11:45:03 +0000 MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Cc: From: "James Richardson" X-Mailer: Microsoft Outlook v 11.00.5510, MSOC v 2.00.4007.00 Message-ID: X-MIMETrack: Serialize by Router on sdbo1003/DMGUK/DeuBaInt/DeuBa(5013aHF19 | July 26, 2004) at 10/01/2005 11:45:13 AM, Serialize complete at 10/01/2005 11:45:13 AM Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org