cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java

2005-07-16 Thread mturk
mturk   2005/07/16 05:11:11

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
  Log:
  Add APR_SO_REUSEADDR and APR_SO_KEEPALIVE to the listening
  socket. This resolves 'address in use exception', and is the way how
  the Apache HTTPD is using the APR.
  See the: server/listen.c
  
  Revision  ChangesPath
  1.66  +8 -0  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
  
  Index: AprEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- AprEndpoint.java  15 Jul 2005 15:40:00 -  1.65
  +++ AprEndpoint.java  16 Jul 2005 12:11:11 -  1.66
  @@ -24,6 +24,7 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.tomcat.jni.OS;
   import org.apache.tomcat.jni.Address;
   import org.apache.tomcat.jni.Error;
   import org.apache.tomcat.jni.File;
  @@ -511,6 +512,9 @@
   // Create the APR server socket
   serverSock = Socket.create(Socket.APR_INET, Socket.SOCK_STREAM,
   Socket.APR_PROTO_TCP, rootPool);
  +if (OS.IS_UNIX) {
  +Socket.optSet(serverSock, Socket.APR_SO_REUSEADDR, 1);
  +}
   // Bind the server socket
   int ret = Socket.bind(serverSock, inetAddress);
   if (ret != 0) {
  @@ -521,6 +525,10 @@
   if (ret != 0) {
   throw new Exception(sm.getString(endpoint.init.listen,  + 
ret));
   }
  +if (OS.IS_WIN32 || OS.IS_WIN64) {
  +// On Windows set the reuseaddr flag after the bind/listen
  +Socket.optSet(serverSock, Socket.APR_SO_REUSEADDR, 1);
  +}
   
   // Sendfile usage on systems which don't support it cause major 
problems
   if (useSendfile  !Library.APR_HAS_SENDFILE) {
  
  
  

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



DO NOT REPLY [Bug 35765] New: - make the SSL cipher config in web.xml fail safe, i.e. 128+ bit strength by default

2005-07-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=35765.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35765

   Summary: make the SSL cipher config in web.xml fail safe, i.e.
128+ bit strength by default
   Product: Tomcat 5
   Version: Nightly Build
  Platform: Other
   URL: http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/
JSSERefGuide.html#AppA
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Connector:Coyote
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


When just taking the samples, even null ciphers are accepted!

How about 
1) defining a default cipher suite equivalent to the MEDIUM:HIGH
of openssl (http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS) that
is also used by the apache httpd
(http://httpd.apache.org/docs-2.0/mod/mod_ssl.html#sslciphersuite)

2) changing org.apache.tomcat.util.net.jsse.JSSESocketFactory.getEnabledCiphers
for the case that 
requestedCiphers == null
not simply do a 
 enabledCiphers = supportedCiphers;
but use this fail-safe default cipher suite (based upon the above-referenced
JSSERefGuide.html)?

as a quick-fix, I suggest to add a well-visible warning to ssl-howto.xml

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java

2005-07-16 Thread mturk
mturk   2005/07/16 05:22:42

  Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java
  Log:
  Add a missing SO_KEEPALIVE option.
  See the previous commit for an explanation.
  
  Revision  ChangesPath
  1.67  +2 -0  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
  
  Index: AprEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- AprEndpoint.java  16 Jul 2005 12:11:11 -  1.66
  +++ AprEndpoint.java  16 Jul 2005 12:22:42 -  1.67
  @@ -515,6 +515,8 @@
   if (OS.IS_UNIX) {
   Socket.optSet(serverSock, Socket.APR_SO_REUSEADDR, 1);
   }
  +// Deal with the firewalls that tend to drop the inactive sockets
  +Socket.optSet(serverSock, Socket.APR_SO_KEEPALIVE, 1);
   // Bind the server socket
   int ret = Socket.bind(serverSock, inetAddress);
   if (ret != 0) {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/common HandlerRequest.java JkInputStream.java

2005-07-16 Thread billbarker
billbarker2005/07/16 13:54:05

  Modified:jk/java/org/apache/jk/common HandlerRequest.java
JkInputStream.java
  Log:
  Copy the idea from the APR Connector, and delay reading the initial request 
body packet until the Servlet asks for it.
  
  This reduces the chance that the socket read will block uselessly waiting for 
the data to be available.  You can restore the previous behavior by setting 
request.delayInitialRead=false on the Connector.
  
  Of course, if Bill R. decides to port his C-L patch for proxy_http to mod_jk, 
the value of this setting won't matter :).
  
  Revision  ChangesPath
  1.48  +28 -10
jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java
  
  Index: HandlerRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- HandlerRequest.java   30 Jun 2005 02:49:38 -  1.47
  +++ HandlerRequest.java   16 Jul 2005 20:54:05 -  1.48
  @@ -168,6 +168,20 @@
   return registerRequests;
   }
   
  +/**
  + * Set the flag to delay the initial body read
  + */
  +public void setDelayInitialRead(boolean dir) {
  + delayInitialRead = dir;
  +}
  +
  +/**
  + * Get the flag to tell if we delay the initial body read
  + */
  +public boolean getDelayInitialRead() {
  + return delayInitialRead;
  +}
  +
   //  Ajp13.id 
   
   private void generateAjp13Id() {
  @@ -210,14 +224,15 @@
   }
   
   //  Incoming message 
  -String requiredSecret=null;
  -int secretNote;
  -int tmpBufNote;
  -
  -boolean decoded=true;
  -boolean tomcatAuthentication=true;
  -boolean registerRequests=true;
  -boolean shutdownEnabled=false;
  +private String requiredSecret=null;
  +private int secretNote;
  +private int tmpBufNote;
  +
  +private boolean decoded=true;
  +private boolean tomcatAuthentication=true;
  +private boolean registerRequests=true;
  +private boolean shutdownEnabled=false;
  +private boolean delayInitialRead = true;
   
   public int invoke(Msg msg, MsgContext ep ) 
   throws IOException{
  @@ -393,8 +408,11 @@
   // immediately after
   int cl=req.getContentLength();
   if(cl  0) {
  -// This is hidious.  Look to remove it.
  -ep.getInputStream().receive();
  +JkInputStream jkIS = ep.getInputStream();
  +jkIS.setIsReadRequired(true);
  +if(!delayInitialRead) {
  +jkIS.receive();
  +}
   }
   
   if (log.isTraceEnabled()) {
  
  
  
  1.20  +26 -0 
jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java
  
  Index: JkInputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JkInputStream.java30 Jun 2005 02:49:38 -  1.19
  +++ JkInputStream.java16 Jul 2005 20:54:05 -  1.20
  @@ -50,6 +50,7 @@
   private boolean isEmpty = true;
   private boolean isFirst = true;
   private boolean isReplay = false;
  +private boolean isReadRequired = false;
   
   static {
   // Make certain HttpMessages is loaded for SecurityManager
  @@ -66,14 +67,39 @@
   
   //  Jk specific methods 
   
  +
  +/**
  + * Set the flag saying that the server is sending a body
  + */
  +public void setIsReadRequired(boolean irr) {
  +isReadRequired = irr;
  +}
  +
  +/**
  + * Return the flag saying that the server is sending a body
  + */
  +public boolean isReadRequired() {
  +return isReadRequired;
  +}
  +
   
   /** Must be called before or after each request
*/
   public void recycle() {
  +if(isReadRequired  isFirst) {
  +// The Servlet never read the request body, so we need to junk it
  +try {
  +  receive();
  +} catch(IOException iex) {
  +  log.debug(Error consuming request body,iex);
  +}
  +}
  +
   end_of_stream = false;
   isEmpty = true;
   isFirst = true;
   isReplay = false;
  +isReadRequired = false;
   bodyBuff.recycle();
   tempMB.recycle();
   }
  
  
  

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

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session DeltaManager.java SimpleTcpReplicationManager.java

2005-07-16 Thread pero
pero2005/07/16 14:00:12

  Modified:modules/cluster/src/share/org/apache/catalina/cluster
CatalinaCluster.java ClusterManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java SimpleTcpReplicationManager.java
  Log:
  Open Cluster APi that Context can have its own Cluster Manager config.
  
  Revision  ChangesPath
  1.13  +3 -4  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/CatalinaCluster.java
  
  Index: CatalinaCluster.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/CatalinaCluster.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CatalinaCluster.java  9 Jun 2005 20:37:33 -   1.12
  +++ CatalinaCluster.java  16 Jul 2005 21:00:12 -  1.13
  @@ -19,11 +19,10 @@
   import java.util.Map;
   
   import org.apache.catalina.Cluster;
  -import org.apache.catalina.cluster.io.ListenCallback;
   import org.apache.catalina.LifecycleException;
  +import org.apache.catalina.Manager;
   import org.apache.catalina.Valve;
   import org.apache.commons.logging.Log;
  -import org.apache.catalina.Manager;
   
   /**
* A bCatalinaCluster/b interface allows to plug in and out the 
  @@ -124,7 +123,7 @@
*/
   public Map getManagers();
   public Manager getManager(String name);
  -public void removeManager(String name);
  +public void removeManager(String name,Manager manager);
   public void addManager(String name,Manager manager);
   public Valve[] getValves();
   
  
  
  
  1.10  +27 -2 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java
  
  Index: ClusterManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ClusterManager.java   9 Jun 2005 20:37:33 -   1.9
  +++ ClusterManager.java   16 Jul 2005 21:00:12 -  1.10
  @@ -59,17 +59,42 @@
  public String[] getInvalidatedSessions();
  
  /**
  -* Return the name of the manager, typically the context name such as 
/replicator
  +* Return the name of the manager, at host /context name and at engine 
hostname+/context
   * @return String
  +* @since 5.5.10
   */
  public String getName();
  
  +   /**
  +* Set the name of the manager, at host /context name and at engine 
hostname+/context
  +* @param name
  +* @since 5.5.10
  +*/
  public void setName(String name);

  public CatalinaCluster getCluster();
  public void setCluster(CatalinaCluster cluster);
  +   
  +   /**
  +* @return Manager send only to same cluster domain
  +* @since 5.5.10
  +*/
  public boolean isSendClusterDomainOnly() ;
  +   /**
  +* @param boolean
  +* @since 5.5.10
  +*/
  public void setSendClusterDomainOnly(boolean sendClusterDomainOnly) ;
  - 
  +   /**
  +* @param mode
  +* @since 5.5.10
  +*/
  +   public void setDefaultMode(boolean  mode) ;
  +   /**
  +* @param overwrite properties from SimpleTcpCluster
  +* @since 5.5.10
  +*/
  +   public boolean isDefaultMode() ;
  +   
  
   }
  \ No newline at end of file
  
  
  
  1.50  +18 -2 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- DeltaManager.java 1 Jul 2005 16:47:10 -   1.49
  +++ DeltaManager.java 16 Jul 2005 21:00:12 -  1.50
  @@ -100,6 +100,8 @@
   
   protected String name = null;
   
  +protected boolean defaultMode = false;
  +
   private CatalinaCluster cluster = null;
   
   /**
  @@ -497,6 +499,20 @@
   this.notifyListenersOnReplication = notifyListenersOnReplication;
   }
   
  +
  +/**
  + * @return Returns the defaultMode.
  + */
  +public boolean isDefaultMode() {
  +return defaultMode;
  +}
  +/**
  + * @param defaultMode The defaultMode to set.
  + */
  +public void setDefaultMode(boolean defaultMode) {
  +this.defaultMode = defaultMode;
  +}
  +
   public CatalinaCluster getCluster() {
   return cluster;
   }
  @@ -1112,7 +1128,7 @@
   if (log.isDebugEnabled())
   

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp DataSenders.properties DataSender.java IDataSender.java IDataSenderFactory.java LocalStrings.properties

2005-07-16 Thread pero
pero2005/07/16 14:02:30

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/tcp
DataSender.java IDataSender.java
IDataSenderFactory.java LocalStrings.properties
  Added:   modules/cluster/src/share/org/apache/catalina/cluster/tcp
DataSenders.properties
  Log:
  Made cluster modes configurable!
  Setup your own DataSender at server classpath DataSenders.properties
  
  Revision  ChangesPath
  1.15  +17 -2 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/DataSender.java
  
  Index: DataSender.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/DataSender.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DataSender.java   8 Jul 2005 20:50:30 -   1.14
  +++ DataSender.java   16 Jul 2005 21:02:17 -  1.15
  @@ -211,7 +211,7 @@
   
   
   // - 
Constructor
  -
  +
   public DataSender(String domain,InetAddress host, int port) {
   this.address = host;
   this.port = port;
  @@ -396,10 +396,25 @@
   return dataFailureCounter;
   }
   
  +/**
  + * @param address The address to set.
  + */
  +public void setAddress(InetAddress address) {
  +this.address = address;
  +}
  +
   public InetAddress getAddress() {
   return address;
   }
   
  +
  +/**
  + * @param port The port to set.
  + */
  +public void setPort(int port) {
  +this.port = port;
  +}
  +
   public int getPort() {
   return port;
   }
  
  
  
  1.11  +3 -1  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/IDataSender.java
  
  Index: IDataSender.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/IDataSender.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- IDataSender.java  26 Jun 2005 21:21:50 -  1.10
  +++ IDataSender.java  16 Jul 2005 21:02:17 -  1.11
  @@ -18,13 +18,15 @@
   
   /**
* @author Peter Rossbach
  - * @version 1.0
  + * @version $Revision$ $Date$
* @since 5.5.7
*/
   
   public interface IDataSender
   {
  +public void setAddress(java.net.InetAddress address);
   public java.net.InetAddress getAddress();
  +public void setPort(int port);
   public int getPort();
   public void connect() throws java.io.IOException;
   public void disconnect();
  
  
  
  1.6   +150 -25   
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/IDataSenderFactory.java
  
  Index: IDataSenderFactory.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/IDataSenderFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IDataSenderFactory.java   9 Jun 2005 20:37:33 -   1.5
  +++ IDataSenderFactory.java   16 Jul 2005 21:02:17 -  1.6
  @@ -15,46 +15,171 @@
*/
   
   package org.apache.catalina.cluster.tcp;
  -import org.apache.catalina.cluster.Member;
  +
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.lang.reflect.Constructor;
   import java.net.InetAddress;
  +import java.util.Iterator;
  +import java.util.Properties;
  +
  +import org.apache.catalina.cluster.Member;
  +import org.apache.catalina.util.StringManager;
   
   /**
  + * Create DataSender for different modes. DataSender factory load mode list 
from 
  + * codeorg/apache/catalina/cluster/tcp/DataSenders.properties/code 
resource.
  + * 
* @author Peter Rossbach
  - * @version 1.0
  + * @version $Revision$ $Date$
* @since 5.5.7
*/
   public class IDataSenderFactory {
  +
  +private static org.apache.commons.logging.Log log = 
org.apache.commons.logging.LogFactory
  +.getLog(IDataSenderFactory.class);
  +
  +private static final String DATASENDERS_PROPERTIES = 
org/apache/catalina/cluster/tcp/DataSenders.properties;
  +public static final String SYNC_MODE = synchronous;
  +public static final String ASYNC_MODE = asynchronous;
  +public static final String POOLED_SYNC_MODE = pooled;
  +public static final String FAST_ASYNC_QUEUE_MODE = fastasyncqueue;
  +
  +/**
  + * The string manager for this package.
  + */
  +protected static StringManager sm = StringManager
  +.getManager(Constants.Package);
  +
  +// - Instance 
Variables
  +
  +

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp SimpleTcpCluster.java

2005-07-16 Thread pero
pero2005/07/16 14:04:37

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/tcp
SimpleTcpCluster.java
  Log:
  Open Cluster APi that Context can have its own Cluster Manager config.
  
  Revision  ChangesPath
  1.71  +56 -12
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
  
  Index: SimpleTcpCluster.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- SimpleTcpCluster.java 8 Jul 2005 20:50:30 -   1.70
  +++ SimpleTcpCluster.java 16 Jul 2005 21:04:37 -  1.71
  @@ -32,6 +32,9 @@
   import javax.management.modelmbean.ModelMBean;
   
   import org.apache.catalina.Container;
  +import org.apache.catalina.Context;
  +import org.apache.catalina.Engine;
  +import org.apache.catalina.Host;
   import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
  @@ -335,11 +338,20 @@
   this.membershipService = membershipService;
   }
   
  +/**
  + * Add cluster valve 
  + * Cluster Valves are only add to container when cluster is started!
  + * @param new cluster Valve.
  + */
   public void addValve(Valve valve) {
   if (valve instanceof ClusterValve)
   valves.add(valve);
   }
   
  +/**
  + * get all cluster valves
  + * @return current cluster valves
  + */
   public Valve[] getValves() {
   return (Valve[]) valves.toArray(new Valve[valves.size()]);
   }
  @@ -392,6 +404,10 @@
   this.clusterDeployer = clusterDeployer;
   }
   
  +/**
  + * Get all current cluster members
  + * @return all members or empty array 
  + */
   public Member[] getMembers() {
   Member[] members = membershipService.getMembers();
   if(members != null) {
  @@ -437,12 +453,17 @@
   
   properties.put(name, value);
   if(started) {
  +// FIXME Hmm, is that correct when some DeltaManagers are direct 
configured inside Context?
  +// Why we not support it for other elements, like sender, 
receiver or membership?
  +// Must we restart element after change?
   if (name.startsWith(manager)) {
   String key = name.substring(manager.length() + 1);
   String pvalue = value.toString();
   for (Iterator iter = managers.values().iterator(); 
iter.hasNext();) {
   Manager manager = (Manager) iter.next();
  -IntrospectionUtils.setProperty(manager, key, pvalue );
  +if(manager instanceof DeltaManager  ((ClusterManager) 
manager).isDefaultMode()) {
  +IntrospectionUtils.setProperty(manager, key, pvalue 
);
  +}
   }
   } 
   }
  @@ -529,8 +550,10 @@
   if(manager != null) {
   manager.setDistributable(true);
   if (manager instanceof ClusterManager) {
  -((ClusterManager) manager).setName(name);
  -((ClusterManager) manager).setCluster(this);
  +ClusterManager cmanager = (ClusterManager) manager ;
  +cmanager.setDefaultMode(true);
  +cmanager.setName(getManagerName(name,manager));
  +cmanager.setCluster(this);
   }
   }
   }
  @@ -540,15 +563,14 @@
   /**
* remove an application form cluster replication bus
* 
  - * @see 
org.apache.catalina.cluster.CatalinaCluster#removeManager(java.lang.String)
  + * @see 
org.apache.catalina.cluster.CatalinaCluster#removeManager(java.lang.String,Manager)
*/
  -public void removeManager(String name) {
  -Manager manager = getManager(name);
  +public void removeManager(String name,Manager manager) {
   if (manager != null) {
   // Notify our interested LifecycleListeners
   lifecycle.fireLifecycleEvent(BEFORE_MANAGERUNREGISTER_EVENT,
   manager);
  -managers.remove(name);
  +managers.remove(getManagerName(name,manager));
   if (manager instanceof ClusterManager)
   ((ClusterManager) manager).setCluster(null);
   // Notify our interested LifecycleListeners
  @@ -575,16 +597,37 @@
   }
   // Notify our interested LifecycleListeners
   lifecycle.fireLifecycleEvent(BEFORE_MANAGERREGISTER_EVENT, manager);
  +String clusterName = getManagerName(name, manager);
   if (manager instanceof ClusterManager) 

cvs commit: jakarta-tomcat-catalina/modules/cluster build.xml

2005-07-16 Thread pero
pero2005/07/16 14:05:54

  Modified:modules/cluster build.xml
  Log:
  Made cluster modes configurable!
  Setup your own DataSender at server classpath DataSenders.properties
  
  Revision  ChangesPath
  1.18  +2 -0  jakarta-tomcat-catalina/modules/cluster/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/build.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- build.xml 9 Jun 2005 20:37:33 -   1.17
  +++ build.xml 16 Jul 2005 21:05:54 -  1.18
  @@ -89,6 +89,8 @@
  
tofile=${catalina.build}/classes/org/apache/catalina/cluster/session/LocalStrings.properties/
   copy 
file=${basedir}/src/share/org/apache/catalina/cluster/tcp/LocalStrings.properties
  
tofile=${catalina.build}/classes/org/apache/catalina/cluster/tcp/LocalStrings.properties/
  +copy 
file=${basedir}/src/share/org/apache/catalina/cluster/tcp/DataSenders.properties
  +   
tofile=${catalina.build}/classes/org/apache/catalina/cluster/tcp/DataSenders.properties/
   copy 
file=${basedir}/src/share/org/apache/catalina/cluster/session/mbeans-descriptors.xml
  
tofile=${catalina.build}/classes/org/apache/catalina/cluster/session/mbeans-descriptors.xml/
   copy 
file=${basedir}/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml
  
  
  

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



cvs commit: jakarta-tomcat-catalina/modules/cluster to-do.txt

2005-07-16 Thread pero
pero2005/07/16 14:06:34

  Modified:modules/cluster to-do.txt
  Log:
  Document new todo
  Close some todo's
  
  Revision  ChangesPath
  1.18  +32 -5 jakarta-tomcat-catalina/modules/cluster/to-do.txt
  
  Index: to-do.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/to-do.txt,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- to-do.txt 1 Jul 2005 18:40:25 -   1.17
  +++ to-do.txt 16 Jul 2005 21:06:34 -  1.18
  @@ -2,8 +2,6 @@
   Next actions
   ==
   
  -- add mapping sender mapping properties file
  - - let people eaiser extend sender mode
   - Add MbeanFactory to generate dynamic cluster at runtime.
   Problem: How we can start those central services?
   - StandardEngine support load Mbean from external file. 
  @@ -18,6 +16,25 @@
long queues
detect long wait acks
   Idea: Wrote a ant script with the new jmx tasks!
  +Optimzied information access:
  + Create a MBean.attribute that store the complete cluster state 
  + information inside one attribute from type TabularData and 
CompositeData!
  + Implement as SimpleTcpCluster operation
  + Cluster CompositeData
  +   -- Attributes SimpleType
  +   -- ClusterMembership
  +   -- Attributes SimpleType
  +   -- Members CompositeType
  +  -- Attributes SimpeType
  +   -- ClusterReceiver
  +   -- Attributes SimpleType
  +   -- ClusterSender
  +   -- Attributes SimpleType
  +   -- DataSenders TabularData
  +  -- Sender CompositeType
  + -- Attributes SimpeType
  + -- (optional)Queue Stats CompositeData
  + -- Attributes SimpeType   
   - add cluster setup template (src)   
   - documentation
wrote a complete new how-to
  @@ -85,6 +102,9 @@
   
   problems
      
  +- We not set SimpleTcpCluster Properties when element exists inside config.
  + Element must have all properties!! - Note inside docs!!   
  + 
   - How we can stop the request traffic when restart an application?
   currently the jk 1.2.10 can only disable the complete loadbalancer,
   but this detect only the new session request desicion.
  @@ -180,9 +200,16 @@
   - Add single sign on support
   
   ==   
  -COMPLETED (pero)
  +COMPLETED
   ==
  -5.5.10
  +5.5.10 (pero)
  +- add mapping sender mapping properties file (IDataSenderFactory)
  + - let advanced people eaiser implemented there own sender mode
  +- We register different application with same name from different host?
  + SimpleTcpManager register manager with app name + hostname when Cluster 
is configured as Engine element.
  +- Configured DeltaManager inside context
  + - SimpleTcpCluster setProperty and transferproperty reflect changes 
only to defaultMode managers
  +- Look inside SimpleTcpCluster.addManager and DeltaManager.start?
   - Session serialization eat memory but now we can send session messages with 
blocks...
When all sessions serialze after GET_ALL_SESSION is received following 
works
- find all sessions
  @@ -272,7 +299,7 @@
   - Add new SocketReplicationListener
   - Add Stats to DeltaManager
   
  -5.5.9
  +5.5.9  (pero)
   - JMX friendly
   pero:  Add some MBeanSupport to SimpleTCPCluster, ReplicationTransmitter 
and Senders
   - Add Keep Alive and WaitForAck at async mode implementation.
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorTask.java

2005-07-16 Thread pero
pero2005/07/16 14:09:21

  Modified:catalina/src/share/org/apache/catalina/ant/jmx
JMXAccessorTask.java
  Log:
  Support JMX OpenTypes as createProperties
  
  Revision  ChangesPath
  1.6   +33 -5 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorTask.java
  
  Index: JMXAccessorTask.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorTask.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JMXAccessorTask.java  8 Jul 2005 20:54:40 -   1.5
  +++ JMXAccessorTask.java  16 Jul 2005 21:09:21 -  1.6
  @@ -24,6 +24,7 @@
   import java.net.UnknownHostException;
   import java.util.HashMap;
   import java.util.Iterator;
  +import java.util.List;
   import java.util.Map;
   import java.util.Set;
   import java.util.StringTokenizer;
  @@ -31,7 +32,12 @@
   import javax.management.MBeanServerConnection;
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
  +import javax.management.openmbean.CompositeData;
   import javax.management.openmbean.CompositeDataSupport;
  +import javax.management.openmbean.CompositeType;
  +import javax.management.openmbean.OpenType;
  +import javax.management.openmbean.SimpleType;
  +import javax.management.openmbean.TabularDataSupport;
   import javax.management.remote.JMXConnector;
   import javax.management.remote.JMXConnectorFactory;
   import javax.management.remote.JMXServiceURL;
  @@ -105,7 +111,7 @@
   /**
* Descriptive information describing this implementation.
*/
  -private static final String info = 
org.apache.catalina.ant.JMXAccessorTask/1.0;
  +private static final String info = 
org.apache.catalina.ant.JMXAccessorTask/1.1;
   
   /**
* Return descriptive information about this implementation and the
  @@ -580,12 +586,34 @@
   propertyPrefix = ;
   if (result instanceof CompositeDataSupport) {
   CompositeDataSupport data = (CompositeDataSupport) result ;
  -Set keys = data.getCompositeType().keySet() ;
  +CompositeType compositeType = data.getCompositeType();
  +Set keys = compositeType.keySet() ;
   for (Iterator iter = keys.iterator(); iter.hasNext();) {
   String key = (String) iter.next();  
   Object value = data.get(key);
  -setProperty(propertyPrefix + . + key , value); 
   
  -}
  +OpenType type = compositeType.getType(key);
  +if(type instanceof SimpleType ) {
  +setProperty(propertyPrefix + . + key , value); 
   
  +} else { 
  +createProperty(propertyPrefix + . + key, value );
  +}
  +}
  +} else if (result instanceof TabularDataSupport) {
  +TabularDataSupport data = (TabularDataSupport) result ;
  +for (Iterator iter = data.keySet().iterator(); iter.hasNext();) {
  +Object key = iter.next();
  +for(Iterator iter1 = ((List)key).iterator(); 
iter1.hasNext();) {
  +Object key1= iter1.next();
  +CompositeData valuedata = data.get(new Object[] { key1 } 
);
  +Object value = valuedata.get(value);
  +OpenType type = 
valuedata.getCompositeType().getType(value);
  +if(type instanceof SimpleType ) {
  +setProperty(propertyPrefix + . + key1 , value);

  +} else { 
  +createProperty(propertyPrefix + . + key1, value );
  +}
  +}
  +}
   } else if (result.getClass().isArray()) {
   if (isSeparatearrayresults()) {
   Object array[] = (Object[]) result;
  
  
  

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



Re: How to make JSP Pages Timed ???

2005-07-16 Thread cmllpz
 I might be missing something here, but why not timing/constraining the users?

 Ouf course all users would have to register then.

 Albretch

Quoting Abdullah Abdullah [EMAIL PROTECTED]:

 Dear all
 
 I am creating web pages using JSP. These JSP pages should be timed. That 
 means the system should be limited with start and end dates or times. I have
 
 created a table in database that contains the start and end times. So, How 
 can I use these times to limit my JSP pages showing from the public 
 
 I am beginner so please be discriptive please !!!
 
 Thanks in advance
 
 _
 Be the first to hear what's new at MSN - sign up to our free newsletters! 
 http://www.msn.co.uk/newsletters
 
 
 -
 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]



DO NOT REPLY [Bug 35769] New: - Wrong implementation of javax.naming.Context.composeName

2005-07-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=35769.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35769

   Summary: Wrong implementation of javax.naming.Context.composeName
   Product: Tomcat 4
   Version: 4.1.31
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


The implementation of javax.naming.Context.composeName( Name, Name) is wrong and
return erroneous results.

In following classes:
- org.apache.naming.NamingContext
- org.apache.naming.BaseDirContext
- org.apache.naming.ProxyDirContext
- org.apache.naming.SelectorContext

The current implementation is:

public Name composeName(Name name, Name prefix)
throws NamingException {
prefix = (Name) name.clone();   // here is the error
return prefix.addAll(name);
}

So, on a Context ctx
A call like ctx.composeName(foo/bar, example/prefix)
might return a Name like example/prefix/foo/bar
but actually return foo/bar/foo/bar !

The correct implementation is:

public Name composeName(Name name, Name prefix)
throws NamingException {
prefix = (Name) prefix.clone();
return prefix.addAll(name);
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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