/**
* Register a manager with the cluster. If the cluster is not responsible
* for creating a manager, then the container will at least notify the
- * cluster that this mananger is participating in the cluster.
+ * cluster that this manager is participating in the cluster.
* @param manager Manager
*/
public void registerManager(Manager manager);
* fields using the request and response objects. Between the end of the processing
* of this event, and the beginning of the processing of the end or error events,
* it is possible to use the response object to write data on the open connection.
- * Note that the response object and depedent OutputStream and Writer are still
+ * Note that the response object and dependent OutputStream and Writer are still
* not synchronized, so when they are accessed by multiple threads,
* synchronization is mandatory. After processing the initial event, the request
* is considered to be committed.
* Ends the Comet session. This signals to the container that
* the container wants to end the comet session. This will send back to the
* client a notice that the server has no more data to send as part of this
- * request. The servlet should perform any needed cleanup as if it had recieved
+ * request. The servlet should perform any needed cleanup as if it had received
* an END or ERROR event.
*
* @throws IOException if an IO exception occurs
/**
* This interface should be implemented by servlets which would like to handle
- * asynchronous IO, recieving events when data is available for reading, and
+ * asynchronous IO, receiving events when data is available for reading, and
* being able to output data without the need for being invoked by the container.
* Note: When this interface is implemented, the service method of the servlet will
* never be called, and will be replaced with a begin event.
/**
- * Remove the tag library location forthe specified tag library URI.
+ * Remove the tag library location for the specified tag library URI.
*
* @param uri URI, relative to the web.xml file
*/
/**
* Get the server.xml <context> attribute's xmlNamespaceAware.
- * @return true if namespace awarenes is enabled.
+ * @return true if namespace awareness is enabled.
*
*/
public boolean getXmlNamespaceAware();
/**
* Get the server.xml <host> attribute's xmlNamespaceAware.
- * @return true if namespace awarenes is enabled.
+ * @return true if namespace awareness is enabled.
*/
public boolean getTldNamespaceAware();
/**
* Return the value of the auto deploy flag. If true, it indicates that
- * this host's child webapps should be discovred and automatically
+ * this host's child webapps should be discovered and automatically
* deployed dynamically.
*/
public boolean getAutoDeploy();
/**
* Return the value of the deploy on startup flag. If true, it indicates
- * that this host's child webapps should be discovred and automatically
+ * that this host's child webapps should be discovered and automatically
* deployed.
*/
public boolean getDeployOnStartup();
/**
* Get the server.xml <host> attribute's xmlNamespaceAware.
- * @return true if namespace awarenes is enabled.
+ * @return true if namespace awareness is enabled.
*
*/
public boolean getXmlNamespaceAware();
/**
* <p>Set the Valve instance that has been distinguished as the basic
- * Valve for this Pipeline (if any). Prioer to setting the basic Valve,
+ * Valve for this Pipeline (if any). Prior to setting the basic Valve,
* the Valve's <code>setContainer()</code> will be called, if it
* implements <code>Contained</code>, with the owning Container as an
* argument. The method may throw an <code>IllegalArgumentException</code>
*
* @exception IllegalArgumentException if this Container refused to
* accept the specified Valve
- * @exception IllegalArgumentException if the specifie Valve refuses to be
+ * @exception IllegalArgumentException if the specified Valve refuses to be
* associated with this Container
* @exception IllegalStateException if the specified Valve is already
* associated with a different Container
/**
* Flag which indicates that, if redirected, output should also be
- * always sent to the log. Default is that otput is sent only to
+ * always sent to the log. Default is that output is sent only to
* redirected streams.
*/
protected boolean alwaysLog = false;
}
/*
* Due to depends chain, Ant could call the Task more than once,
- * this is to prevent that we attempt to reuse the previuosly
+ * this is to prevent that we attempt to reuse the previously
* closed Streams.
*/
redirectOutStream = null;
/**
* Handles output with ERR priority to error stream and all other
- * pritorities to output stream.
+ * priorities to output stream.
*
* @param output The output to log. Should not be <code>null</code>.
*/
/**
* Handles output with ERR priority to error stream and all other
- * pritorities to output stream, then flushes the stream.
+ * priorities to output stream, then flushes the stream.
*
* @param output The output to log. Should not be <code>null</code>.
*/
}
/**
- * check correct lb and worker pararmeter
+ * check correct lb and worker parameter
*/
protected void checkParameter() {
if (worker == null) {
* </pre>
* with attribute <em>attributebinding="true"</em> you can get
* all attributes also from result objects.<br/>
- * The poperty manager.lenght show the size of the result
- * and with manager.[0..lenght].name the
+ * The property manager.lenght show the size of the result
+ * and with manager.[0..length].name the
* resulted ObjectNames are saved.
* These tasks require Ant 1.6 or later interface.
*
/**
* Call Mbean server for some mbeans with same domain, attributes.
- * with <em>attributebindung=true</em> you can save all attributes from all found objects
+ * with <em>attributebinding=true</em> you can save all attributes from all found objects
* as your ant properties
* @param jmxServerConnection
* @param qry
/**
- * Get MBean Attriute from Mbean Server
+ * Get MBean Attribute from Mbean Server
* @param jmxServerConnection
* @param name
* @param attribute
* an array and isSeparateArrayResults is true, resultproperty used as
* prefix (<code>resultproperty.0-array.length</code> and store the
* result array length at <code>resultproperty.length</code>. Other
- * option is that you delemit your result with a delimiter
+ * option is that you delimit your result with a delimiter
* (java.util.StringTokenizer is used).
*
* @param propertyPrefix
* Basic implementation of the <b>Valve</b> interface that enforces the
* <code><security-constraint></code> elements in the web application
* deployment descriptor. This functionality is implemented as a Valve
- * so that it can be ommitted in environments that do not require these
+ * so that it can be omitted in environments that do not require these
* features. Individual implementations of each supported authentication
* method can subclass this base class as required.
* <p>
/**
* Does this request match the saved one (so that it must be the redirect
- * we signalled after successful authentication?
+ * we signaled after successful authentication?
*
* @param request The request to be verified
*/
Iterator<String> names = saved.getHeaderNames();
while (names.hasNext()) {
String name = names.next();
- // The browser isn't expecting this conditional reposponse now.
+ // The browser isn't expecting this conditional response now.
// Assuming that it can quietly recover from an unexpected 412.
// BZ 43687
if(!("If-Modified-Since".equalsIgnoreCase(name) ||
/**
* A <strong>Valve</strong> that supports a "single sign on" user experience,
* where the security identity of a user who successfully authenticates to one
- * web application is propogated to other web applications in the same
+ * web application is propagated to other web applications in the same
* security domain. For successful use, the following requirements must
* be met:
* <ul>
/**
- * The server port to which we should pretent requests to this Connector
+ * The server port to which we should pretend requests to this Connector
* were directed. This is useful when operating Tomcat behind a proxy
* server, so that redirects get constructed accurately. If not specified,
* the port number specified by the <code>port</code> property is used.
/**
- * Look for SSL sesison ID if required. Only look for SSL Session ID if it
+ * Look for SSL session ID if required. Only look for SSL Session ID if it
* is the only tracking method enabled.
*/
protected void parseSessionSslId(Request request) {
/**
* Close the stream
* Since we re-cycle, we can't allow the call to super.close()
- * which would permantely disable us.
+ * which would permanently disable us.
*/
@Override
public void close() throws IOException {
/**
- * Coyote implementation of the buffred reader.
+ * Coyote implementation of the buffered reader.
*
* @author Remy Maucherat
*/
/**
* The buffer used by Tomcat response. This is a derivative of the Tomcat 3.3
* OutputBuffer, with the removal of some of the state handling (which in
- * Coyote is mostly the Processor's responsability).
+ * Coyote is mostly the Processor's responsibility).
*
* @author Costin Manolache
* @author Remy Maucherat
/**
- * The preferred Locales assocaited with this Request.
+ * The preferred Locales associated with this Request.
*/
protected ArrayList<Locale> locales = new ArrayList<Locale>();
/**
* Set the URI converter.
*
- * @param URIConverter the new URI connverter
+ * @param URIConverter the new URI converter
*/
protected void setURIConverter(B2CConverter URIConverter) {
this.URIConverter = URIConverter;
listener.attributeRemoved(event);
} catch (Throwable t) {
context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
- // Error valve will pick this execption up and display it to user
+ // Error valve will pick this exception up and display it to user
attributes.put( Globals.EXCEPTION_ATTR, t );
}
}
}
} catch (Throwable t) {
context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
- // Error valve will pick this execption up and display it to user
+ // Error valve will pick this exception up and display it to user
attributes.put( Globals.EXCEPTION_ATTR, t );
}
}
/**
- * Set the set of cookies recieved with this Request.
+ * Set the set of cookies received with this Request.
*/
public void setCookies(Cookie[] cookies) {
if (userPrincipal == null)
return (false);
- // Identify the Realm we will use for checking role assignmenets
+ // Identify the Realm we will use for checking role assignments
if (context == null)
return (false);
Realm realm = context.getRealm();
/*
* Clone the returned array only if there is a security manager
- * in place, so that performance won't suffer in the nonsecure case
+ * in place, so that performance won't suffer in the non-secure case
*/
if (SecurityUtil.isPackageProtectionEnabled()){
ret = AccessController.doPrivileged(
/*
* Clone the returned array only if there is a security manager
- * in place, so that performance won't suffer in the nonsecure case
+ * in place, so that performance won't suffer in the non-secure case
*/
if (SecurityUtil.isPackageProtectionEnabled()){
ret = AccessController.doPrivileged(
* of the request. This method must be called prior to reading
* request parameters or reading input using getReader().
*
- * @param charset String containing the name of the chararacter encoding.
+ * @param charset String containing the name of the character encoding.
*/
public void setCharacterEncoding(String charset) {
final StringBuffer sb = new StringBuffer();
//web application code can receive a IllegalArgumentException
- //from the appendCookieValue invokation
+ //from the appendCookieValue invocation
if (SecurityUtil.isPackageProtectionEnabled()) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run(){
/**
* A list of Handlers to use for this service-ref.
*
- * The instanciation of the handler have to be done.
+ * The instantiation of the handler have to be done.
*/
private HashMap<String, ContextHandler> handlers =
new HashMap<String, ContextHandler>();
* include:
* <ul>
* <li>Specifying the port, even if it is port 80, when trying to connect.</li>
- * <li>Cancelling the first authentication dialog box and then trying to
+ * <li>Canceling the first authentication dialog box and then trying to
* reconnect.</li>
* </ul>
*
/**
* A <strong>Valve</strong> that supports a "single sign on" user experience on
* each nodes of a cluster, where the security identity of a user who successfully
- * authenticates to one web application is propogated to other web applications and
+ * authenticates to one web application is propagated to other web applications and
* to other nodes cluster in the same security domain. For successful use, the following
* requirements must be met:
* <ul>
/*
* Listener to provider informations to mod_heartbeat.c
* *msg_format = "v=%u&ready=%u&busy=%u"; (message to send).
- * send the muticast merssage using the format...
+ * send the muticast message using the format...
* what about the bind(IP. port) only IP makes sense (for the moment).
* BTW:v = version :-)
*/
/*
* Listener to provider informations to mod_heartbeat.c
* *msg_format = "v=%u&ready=%u&busy=%u"; (message to send).
- * send the muticast merssage using the format...
+ * send the muticast message using the format...
* what about the bind(IP. port) only IP makes sense (for the moment).
* BTW:v = version :-)
*/
}
/*
- * Modifcation from watchDir war detected!
+ * Modification from watchDir war detected!
*
* @see org.apache.catalina.ha.deploy.FileChangeListener#fileModified(java.io.File)
*/
}
/*
- * War remvoe from watchDir
+ * War remove from watchDir
*
* @see org.apache.catalina.ha.deploy.FileChangeListener#fileRemoved(java.io.File)
*/
protected long totalNrOfMessages = 0;
/**
- * The number of the last message procssed. Message IDs are 1 based.
+ * The number of the last message processed. Message IDs are 1 based.
*/
protected AtomicLong lastMessageProcessed = new AtomicLong(0);
/*--Logic---------------------------------------------------*/
/**
- * check for modification and send notifcation to listener
+ * check for modification and send notification to listener
*/
public void check() {
if (log.isInfoEnabled())
}
/**
- * Set the maximum number of actives Sessions allowed, or -1 for no limit.
+ * Set the maximum number of active Sessions allowed, or -1 for no limit.
*
* @param max
* The new maximum number of sessions
/**
* Load sessions from other cluster node.
- * FIXME replace currently sessions with same id without notifcation.
+ * FIXME replace currently sessions with same id without notification.
* FIXME SSO handling is not really correct with the session replacement!
* @exception ClassNotFoundException
* if a serialized class cannot be found during the reload
}
/**
- * Exipre all find sessions.
+ * Expire all find sessions.
*/
public void expireAllLocalSessions()
{
/**
* This class is used to track the series of actions that happens when
- * a request is executed. These actions will then translate into invokations of methods
+ * a request is executed. These actions will then translate into invocations of methods
* on the actual session.
* This class is NOT thread safe. One DeltaRequest per session
* @author <a href="mailto:fhanik@apache.org">Filip Hanik</a>
private transient DeltaRequest deltaRequest = null;
/**
- * Last time the session was replicatd, used for distributed expiring of
+ * Last time the session was replicated, used for distributed expiring of
* session
*/
private transient long lastTimeReplicated = System.currentTimeMillis();
* backup cluster node, that answered the request. After the response is
* delivered to the client, all subsequent client requests will go directly to
* the backup node. The change of sessionid is also sent to all other cluster
- * nodes. After all that, the session stickyness will work directly to the
+ * nodes. After all that, the session stickiness will work directly to the
* backup node and the traffic will not go back to the failed node after it is
* restarted!
*
}
/**
- * get name of failed reqeust session attribute
+ * get name of failed request session attribute
*
* @param sessionIdAttribute
* The sessionIdAttribute to set.
}
/**
- * Handle jvmRoute stickyness after tomcat instance failed. After this
+ * Handle jvmRoute stickiness after tomcat instance failed. After this
* correction a new Cookie send to client with new jvmRoute and the
- * SessionID change propage to the other cluster nodes.
+ * SessionID change propagate to the other cluster nodes.
*
* @param request current request
* @param response
Response response, String sessionId, String newSessionID, Session catalinaSession) {
lifecycle.fireLifecycleEvent("Before session migration",
catalinaSession);
- // FIXME: setId trigger session Listener, but only chance to registiert manager with correct id!
+ // FIXME: setId trigger session Listener, but only chance to register manager with correct id!
catalinaSession.setId(newSessionID);
// FIXME: Why we remove change data from other running request?
// setId also trigger resetDeltaRequest!!
changeRequestSessionID(request, response, sessionId, newSessionID);
if (getCluster() != null) {
- // now sending the change to all other clusternode!
+ // now sending the change to all other clusternodes!
ClusterManager manager = (ClusterManager)catalinaSession.getManager();
sendSessionIDClusterBackup(manager,request,sessionId, newSessionID);
}
request.setRequestedSessionId(newSessionID);
if(request.isRequestedSessionIdFromCookie())
setNewSessionCookie(request, response,newSessionID);
- // set orginal sessionid at request, to allow application detect the
+ // set original sessionid at request, to allow application detect the
// change
if (sessionIdAttribute != null && !"".equals(sessionIdAttribute)) {
if (log.isDebugEnabled()) {
/**
* clear text event type name (for logging purpose only)
- * @return the event type in a string representating, useful for debugging
+ * @return the event type in a string representation, useful for debugging
*/
public String getEventTypeString()
{
/**
- * reset the active statitics
+ * reset the active statistics
*/
public void resetStatistics() {
totalRequestTime = 0 ;
/**
* Fix memory leak for long sessions with many changes, when no backup member exists!
- * @param request current request after responce is generated
+ * @param request current request after response is generated
* @param isCrossContext check crosscontext threadlocal
*/
protected void resetReplicationRequest(Request request, boolean isCrossContext) {
/**
* notify all listeners from receiving a new message is not ClusterMessage
- * emitt Failure Event to LifecylceListener
+ * emit Failure Event to LifecylceListener
*
* @param message
- * receveived Message
+ * received Message
*/
public boolean accept(Serializable msg, Member sender) {
return (msg instanceof ClusterMessage);
/**
* Find the specified resource in our local repository, and return a
- * <code>URL</code> refering to it, or <code>null</code> if this resource
+ * <code>URL</code> referring to it, or <code>null</code> if this resource
* cannot be found.
*
* @param name Name of the resource to be found
/**
- * Validate a classname. As per SRV.9.7.2, we must restict loading of
+ * Validate a classname. As per SRV.9.7.2, we must restrict loading of
* classes from J2SE (java.*) and classes of the servlet API
* (javax.servlet.*). That should enhance robustness and prevent a number
* of user error (where an older version of servlet.jar would be present
*
* @see ManagerServlet#undeploy(PrintWriter, String)
*
- * @param path Context path of the application to be undeployd
+ * @param path Context path of the application to be undeployed
* @return message String
*/
protected String undeploy(String path) {
// ------------------------------------------------------ Private Constants
// These HTML sections are broken in relatively small sections, because of
- // limited number of subsitutions MessageFormat can process
- // (maximium of 10).
+ // limited number of substitutions MessageFormat can process
+ // (maximum of 10).
private static final String APPS_HEADER_SECTION =
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
try {
MBeanInfo minfo=mBeanServer.getMBeanInfo(oname);
- // can't be null - I thinl
+ // can't be null - I think
String code=minfo.getClassName();
if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) {
code=(String)mBeanServer.getAttribute(oname, "modelerType");
*
* @param writer Writer to render to
* @param path Context path of the application to list session information for
- * @param idle Expire all sessions with idle time ≥ idle for this context
+ * @param idle Expire all sessions with idle time > idle for this context
*/
protected void sessions(PrintWriter writer, String path, int idle) {
// ------------------------------------------------------ Private Constants
// These HTML sections are broken in relatively small sections, because of
- // limited number of subsitutions MessageFormat can process
- // (maximium of 10).
+ // limited number of substitutions MessageFormat can process
+ // (maximum of 10).
private static final String HOSTS_HEADER_SECTION =
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
/**
* Try to get user locale from the session, if possible.
* IMPLEMENTATION NOTE: this method has explicit support for Tapestry 3, Struts 1.x and Spring
- * JSF check the browser meta tag "accept languages" to choose what langage to display.
+ * JSF check the browser meta tag "accept languages" to choose what language to display.
* @param in_session
* @return String
*/
throw new MBeanException(e);
}
- // cannot use side-efects. It's removed and added back each time
+ // cannot use side-effects. It's removed and added back each time
// there is a modification in a resource.
NamingResources nr = ce.getNamingResources();
nr.removeEnvironment(ce.getName());
throw new MBeanException(e);
}
- // cannot use side-efects. It's removed and added back each time
+ // cannot use side-effects. It's removed and added back each time
// there is a modification in a resource.
NamingResources nr = crl.getNamingResources();
nr.removeResourceLink(crl.getName());
cr.setProperty(name, ""+value);
}
- // cannot use side-efects. It's removed and added back each time
+ // cannot use side-effects. It's removed and added back each time
// there is a modification in a resource.
NamingResources nr = cr.getNamingResources();
nr.removeResource(cr.getName());
/**
* Remove an existing Context.
*
- * @param contextName MBean Name of the comonent to remove
+ * @param contextName MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
/**
* Remove an existing Host.
*
- * @param name MBean Name of the comonent to remove
+ * @param name MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
/**
* Remove an existing Loader.
*
- * @param name MBean Name of the comonent to remove
+ * @param name MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
/**
* Remove an existing Manager.
*
- * @param name MBean Name of the comonent to remove
+ * @param name MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
/**
* Remove an existing Realm.
*
- * @param name MBean Name of the comonent to remove
+ * @param name MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
/**
* Remove an existing Valve.
*
- * @param name MBean Name of the comonent to remove
+ * @param name MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
/**
- * Semicolon separated list of paths containing MBean desciptor resources.
+ * Semicolon separated list of paths containing MBean descriptor resources.
*/
protected String descriptors = null;
*/
protected void createMBeans(Connector connector) throws Exception {
- // Create the MBean for the Connnector itself
+ // Create the MBean for the Connector itself
// if (log.isDebugEnabled())
// log.debug("Creating MBean for Connector " + connector);
// MBeanUtils.createMBean(connector);
/**
*
-* Implmentation of <b>Realm</b> that works with any JDBC JNDI DataSource.
+* Implementation of <b>Realm</b> that works with any JDBC JNDI DataSource.
* See the JDBCRealm.howto for more details on how to set up the database and
* for configuration options.
*
/**
- * The column in the user table that holds the user's credintials
+ * The column in the user table that holds the user's credentials
*/
protected String userCredCol = null;
* @param nonce Server generated nonce
* @param nc Nonce count
* @param cnonce Client generated nonce
- * @param qop Quality of protection aplied to the message
+ * @param qop Quality of protection applied to the message
* @param realmName Realm name
* @param md5a2 Second MD5 digest used to calculate the digest
* MD5(Method + ":" + uri)
protected String cnonce = null;
/**
- * Quality of protection aplied to the message.
+ * Quality of protection applied to the message.
*/
protected String qop;
* Retrieve the information requested in the provided <code>Callbacks</code>.
* This implementation only recognizes {@link NameCallback},
* {@link PasswordCallback} and {@link TextInputCallback}.
- * {@link TextInputCallback} is ued to pass the various additional
+ * {@link TextInputCallback} is used to pass the various additional
* parameters required for DIGEST authentication.
*
* @param callbacks The set of <code>Callback</code>s to be processed
* <li><strong>debug</strong> - Set to "true" to get debugging messages
* generated to System.out. The default value is <code>false</code>.</li>
* <li><strong>pathname</strong> - Relative (to the pathname specified by the
- * "catalina.base" system property) or absolute pahtname to the
+ * "catalina.base" system property) or absolute pathname to the
* XML file containing our user information, in the format supported by
* {@link MemoryRealm}. The default value matches the MemoryRealm
* default.</li>
/**
* The <code>Principal</code> identified by our validation, or
- * <code>null</code> if validation falied.
+ * <code>null</code> if validation failed.
*/
protected Principal principal = null;
/**
* Log out this user.
*
- * @return <code>true</code> in all cases because thie
+ * @return <code>true</code> in all cases because the
* <code>LoginModule</code> should not be ignored
*
* @exception LoginException if logging out failed
/**
- * <p>Implmentation of <b>Realm</b> that authenticates users via the <em>Java
+ * <p>Implementation of <b>Realm</b> that authenticates users via the <em>Java
* Authentication and Authorization Service</em> (JAAS). JAAS support requires
* either JDK 1.4 (which includes it as part of the standard platform) or
* JDK 1.3 (with the plug-in <code>jaas.jar</code> file).</p>
* <code>Subject.getPrincipals()</code>, it will identify the first
* <code>Principal</code> that matches the "user classes" list as the
* <code>Principal</code> for this user.</li>
- * <li>As this Realm iterates over the <code>Princpals</code> returned by
+ * <li>As this Realm iterates over the <code>Principals</code> returned by
* <code>Subject.getPrincipals()</code>, it will accumulate the set of
* all <code>Principals</code> matching the "role classes" list as
* identifying the security roles for this user.</li>
* @param nonce Server generated nonce
* @param nc Nonce count
* @param cnonce Client generated nonce
- * @param qop Quality of protection aplied to the message
+ * @param qop Quality of protection applied to the message
* @param realmName Realm name
* @param md5a2 Second MD5 digest used to calculate the digest
* MD5(Method + ":" + uri)
/**
*
-* Implmentation of <b>Realm</b> that works with any JDBC supported database.
+* Implementation of <b>Realm</b> that works with any JDBC supported database.
* See the JDBCRealm.howto for more details on how to set up the database and
* for configuration options.
*
/**
- * The column in the user table that holds the user's credintials
+ * The column in the user table that holds the user's credentials
*/
protected String userCredCol = null;
@Override
public synchronized Principal authenticate(String username, String credentials) {
- // Number of tries is the numebr of attempts to connect to the database
+ // Number of tries is the number of attempts to connect to the database
// during this login attempt (if we need to open the database)
- // This needs rewritten wuth better pooling support, the existing code
+ // This needs rewritten with better pooling support, the existing code
// needs signature changes since the Prepared statements needs cached
// with the connections.
// The code below will try twice if there is a SQLException so the
PreparedStatement stmt = null;
ResultSet rs = null;
- // Number of tries is the numebr of attempts to connect to the database
+ // Number of tries is the number of attempts to connect to the database
// during this login attempt (if we need to open the database)
- // This needs rewritten wuth better pooling support, the existing code
+ // This needs rewritten with better pooling support, the existing code
// needs signature changes since the Prepared statements needs cached
// with the connections.
// The code below will try twice if there is a SQLException so the
PreparedStatement stmt = null;
ResultSet rs = null;
- // Number of tries is the numebr of attempts to connect to the database
+ // Number of tries is the number of attempts to connect to the database
// during this login attempt (if we need to open the database)
// This needs rewritten wuth better pooling support, the existing code
// needs signature changes since the Prepared statements needs cached
// Ensure that we have a directory context available
context = open();
- // Occassionally the directory context will timeout. Try one more
+ // Occasionally the directory context will timeout. Try one more
// time before giving up.
try {
* authentication attempts in a given period of time. To ensure correct
* operation, there is a reasonable degree of synchronisation in this Realm.
* This Realm does not require modification to the underlying Realms or the
- * associated user storage mecahisms. It achieves this by recording all failed
+ * associated user storage mechanisms. It achieves this by recording all failed
* logins, including those for users that do not exist. To prevent a DOS by
* deliberating making requests with invalid users (and hence causing this cache
* to grow) the size of the list of users that have failed authentication is
*/
public boolean hasRole(Principal principal, String role) {
- // Should be overriten in JAASRealm - to avoid pretty inefficient conversions
+ // Should be overridden in JAASRealm - to avoid pretty inefficient conversions
if ((principal == null) || (role == null) ||
!(principal instanceof GenericPrincipal))
return (false);
* @param methodName the method to apply the security restriction
* @param targetObject the <code>Servlet</code> on which the method will
* be called.
- * @param targetType <code>Class</code> array used to instanciate a i
+ * @param targetType <code>Class</code> array used to instantiate a
* <code>Method</code> object.
* @param targetArguments <code>Object</code> array contains the runtime
* parameters instance.
* @param methodName the method to apply the security restriction
* @param targetObject the <code>Servlet</code> on which the method will
* be called.
- * @param targetType <code>Class</code> array used to instanciate a
+ * @param targetType <code>Class</code> array used to instantiate a
* <code>Method</code> object.
* @param targetArguments <code>Object</code> array contains the
* runtime parameters instance.
* @param methodName the method to apply the security restriction
* @param targetObject the <code>Filter</code> on which the method will
* be called.
- * @param targetType <code>Class</code> array used to instanciate a
+ * @param targetType <code>Class</code> array used to instantiate a
* <code>Method</code> object.
* @param targetArguments <code>Object</code> array contains the
* runtime parameters instance.
* @param methodName the method to apply the security restriction
* @param targetObject the <code>Filter</code> on which the method will
* be called.
- * @param targetType <code>Class</code> array used to instanciate a
+ * @param targetType <code>Class</code> array used to instantiate a
* <code>Method</code> object.
* @param targetArguments <code>Object</code> array contains the
* runtime parameters instance.
* @param methodName the method to apply the security restriction
* @param targetObject the <code>Servlet</code> on which the method will
* be called.
- * @param targetType <code>Class</code> array used to instanciate a
+ * @param targetType <code>Class</code> array used to instantiate a
* <code>Method</code> object.
* @return the method instance.
*/
* </p>
* <p>
*
- * <b>Metavariable Values</b>: According to the CGI specificion,
+ * <b>Metavariable Values</b>: According to the CGI specification,
* implementations may choose to represent both null or missing values in an
* implementation-specific manner, but must define that manner. This
* implementation chooses to always define all required metavariables, but
*
* <b>NPH -- Non-parsed-header implementation</b>: This implementation does
* not support the CGI NPH concept, whereby server ensures that the data
- * supplied to the script are preceisely as supplied by the client and
+ * supplied to the script are precisely as supplied by the client and
* unaltered by the server.
* </p>
* <p>
/**
* Constructs the CGI environment to be supplied to the invoked CGI
- * script; relies heavliy on Servlet API methods and findCGI
+ * script; relies heavily on Servlet API methods and findCGI
*
* @param req request associated with the CGI
- * invokation
+ * Invocation
*
* @return true if environment was set OK, false if there
* was a problem and no environment was set
* <p>
*
* The CGI environment and settings are derived from the information
- * passed to the constuctor.
+ * passed to the constructor.
*
* </p>
* <p>
* @param env Hashtable with the desired script environment
* @param wd File with the script's desired working directory
* @param params ArrayList with the script's query command line
- * paramters as strings
+ * parameters as strings
*/
protected CGIRunner(String command, Hashtable<String,String> env,
File wd, ArrayList<String> params) {
/**
* URL rewriter.
*
- * @param path Path which has to be rewiten
+ * @param path Path which has to be rewritten
*/
protected String rewriteUrl(String path) {
return urlEncoder.encode( path );
/**
- * Propfind helper method. Dispays the properties of a lock-null resource.
+ * Propfind helper method. Displays the properties of a lock-null resource.
*
* @param resources Resources object associated with this context
* @param generatedXML XML response to the Propfind request
* providing status for multiple independent operations.
*/
public static final int SC_MULTI_STATUS = 207;
- // This one colides with HTTP 1.1
- // "207 Parital Update OK"
+ // This one collides with HTTP 1.1
+ // "207 Partial Update OK"
/**
* the PATCH method was not understood by the resource.
*/
public static final int SC_UNPROCESSABLE_ENTITY = 418;
- // This one colides with HTTP 1.1
+ // This one collides with HTTP 1.1
// "418 Reauthentication Required"
* execution of this method.
*/
public static final int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
- // This one colides with HTTP 1.1
+ // This one collides with HTTP 1.1
// "419 Proxy Reauthentication Required"
static {
- // HTTP 1.0 tatus Code
+ // HTTP 1.0 status Code
addStatusCodeMap(SC_OK, "OK");
addStatusCodeMap(SC_CREATED, "Created");
addStatusCodeMap(SC_ACCEPTED, "Accepted");
* <code>null</code> or closed try to reopen it.
* Returns <code>null</code> if the connection could not be established.
*
- * @return <code>Connection</code> if the connection suceeded
+ * @return <code>Connection</code> if the connection succeeded
*/
protected Connection getConnection() {
try {
/**
* Extends the <b>ManagerBase</b> class to implement most of the
* functionality required by a Manager which supports any kind of
- * persistence, even if onlyfor restarts.
+ * persistence, even if only for restarts.
* <p>
* <b>IMPLEMENTATION NOTE</b>: Correct behavior of session storing and
* reloading depends upon external calls to the <code>start()</code> and
/**
- * Set the maximum number of actives Sessions allowed, or -1 for
+ * Set the maximum number of active Sessions allowed, or -1 for
* no limit.
*
* @param max The new maximum number of sessions
/**
- * Set the maximum number of actives Sessions allowed, or -1 for
+ * Set the maximum number of active Sessions allowed, or -1 for
* no limit.
*
* @param max The new maximum number of sessions
break;
case ExpressionTokenizer.TOKEN_GE :
pushOpp(new NotNode());
- // Similar stategy to NOT_EQ above, except this
+ // Similar strategy to NOT_EQ above, except this
// is NOT less than
oppStack.add(0, new LessThanNode());
break;
case ExpressionTokenizer.TOKEN_LE :
pushOpp(new NotNode());
- // Similar stategy to NOT_EQ above, except this
+ // Similar strategy to NOT_EQ above, except this
// is NOT greater than
oppStack.add(0, new GreaterThanNode());
break;
}
- //We try to mimick Apache here, as we do everywhere
+ //We try to mimic Apache here, as we do everywhere
//All the 'magic' numbers are from the util_script.c Apache source file.
protected String formatSize(long size, String format) {
String retString = "";
String retVal = null;
int lastSlash = servletPath.lastIndexOf('/');
if (lastSlash >= 0) {
- //cut off file namee
+ //cut off file name
retVal = servletPath.substring(0, lastSlash + 1);
}
return retVal;
/**
* Exception used to tell SSIProcessor that it should stop processing SSI
- * commands. This is used to mimick the Apache behavior in #set with invalid
+ * commands. This is used to mimic the Apache behavior in #set with invalid
* attributes.
*
* @author Paul Speed
* 2. receive message (by registering a <code>ChannelListener</code><br>
* 3. get all members of the group <code>getMembers()</code><br>
* 4. receive notifications of members added and members disappeared by
- * registerering a <code>MembershipListener</code><br>
+ * registering a <code>MembershipListener</code><br>
* <br>
* The channel has 5 major components:<br>
* 1. Data receiver, with a built in thread pool to receive messages from other peers<br>
* to trigger certain behavior. Most flags are used to trigger channel interceptors
* as the message passes through the channel stack. <br>
* However, there are five default flags that every channel implementation must implement<br>
- * SEND_OPTIONS_BYTE_MESSAGE - The message is a pure byte message and no marshalling or unmarshalling will
+ * SEND_OPTIONS_BYTE_MESSAGE - The message is a pure byte message and no marshaling or unmarshaling will
* be performed.<br>
*
* @see #send(Member[], Serializable , int)
* <code>if ( listener.accept(msg,sender) ) listener.messageReceived(msg,sender);</code><br>
* A ChannelListener implementation MUST NOT return true on <code>accept(Serializable, Member)</code>
* if it doesn't intend to process the message. The channel can this way track whether a message
- * was processed by an above application or if it was just received and forgot about, a featuer required
+ * was processed by an above application or if it was just received and forgot about, a feature required
* to support message-response(RPC) calls<br>
*
* @author Filip Hanik
public interface Heartbeat {
/**
- * Heartbeat invokation for resources cleanup etc
+ * Heartbeat invocation for resources cleanup etc
*/
public void heartbeat();
/**
* Returns the listen port for the ChannelReceiver implementation
- * @return the listen port for this member, -1 if its not listening on an unsecure port
+ * @return the listen port for this member, -1 if its not listening on an insecure port
* @see ChannelReceiver
*/
public int getPort();
import java.io.Serializable;
/**
- * <p>Title: Represents a globabally unique Id</p>
+ * <p>Title: Represents a globally unique Id</p>
*
* <p>Company: </p>
*
protected ChannelCoordinator coordinator = new ChannelCoordinator();
/**
- * The first interceptor in the inteceptor stack.
+ * The first interceptor in the interceptor stack.
* The interceptors are chained in a linked list, so we only need a reference to the
* first one
*/
/**
* Returns the sleep time in milliseconds that the internal heartbeat will
- * sleep in between invokations of <code>Channel.heartbeat()</code>
+ * sleep in between invocations of <code>Channel.heartbeat()</code>
* @return long
*/
public long getHeartbeatSleeptime() {
/**
*
* Same implementation as the MessageDispatchInterceptor
- * except is ues an atomic long for the currentSize calculation
+ * except it uses an atomic long for the currentSize calculation
* and uses a thread pool for message sending.
*
* @author Filip Hanik
* @param data new transfer buffer
* @param off offset
* @param len length in buffer
- * @return number of messages that sended to callback
+ * @return number of messages that was sent to callback
* @throws java.io.IOException
*/
public int append(ByteBuffer data, int len, boolean count) throws java.io.IOException {
socket = new MulticastSocket(new InetSocketAddress(address,port));
} catch (BindException e) {
/*
- * On some plattforms (e.g. Linux) it is not possible to bind
+ * On some platforms (e.g. Linux) it is not possible to bind
* to the multicast address. In this case only bind to the
* port.
*/
}
public void add(Member member) {
- // no op, senders created upon demans
+ // no op, senders created upon demands
}
public void remove(Member member) {
/**
- * send a reply-acknowledgement (6,2,3)
+ * send a reply-acknowledgment (6,2,3)
* @param key
* @param channel
*/
* Wait for ack is needed and make auto retry when write message is failed.
* After sending error close and reopen socket again.
*
- * After successfull sending update stats
+ * After successful sending update stats
*
- * WARNING: Subclasses must be very carefull that only one thread call this pushMessage at once!!!
+ * WARNING: Subclasses must be very careful that only one thread call this pushMessage at once!!!
*
* @see #closeSocket()
* @see #openSocket()
}
/**
- * Wait for Acknowledgement from other server
- * FIXME Please, not wait only for three charcters, better control that the wait ack message is correct.
+ * Wait for Acknowledgment from other server
+ * FIXME Please, not wait only for three characters, better control that the wait ack message is correct.
* @param timeout
* @throws java.io.IOException
* @throws java.net.SocketTimeoutException
/**
* A fast queue that remover thread lock the adder thread. <br/>Limit the queue
- * length when you have strange producer thread problemes.
+ * length when you have strange producer thread problems.
*
* FIXME add i18n support to log messages
* @author Rainer Jung
private boolean inMutex = false;
/**
- * limit the queue legnth ( default is unlimited)
+ * limit the queue length ( default is unlimited)
*/
private int maxQueueLength = 0;
}
if ( current != null ) {
if ( remaining > 0 ) {
- //weve written everything, or we are starting a new package
+ //we have written everything, or we are starting a new package
//protect against buffer overwrite
int byteswritten = isUdpBased()?dataChannel.write(writebuf) : socketChannel.write(writebuf);
if (byteswritten == -1 ) throw new EOFException();
delta = System.currentTimeMillis() - start;
}
if ( remaining > 0 ) {
- //timeout has occured
+ //timeout has occurred
ChannelException cxtimeout = new ChannelException("Operation has timed out("+getTimeout()+" ms.).");
if ( cx==null ) cx = new ChannelException("Operation has timed out("+getTimeout()+" ms.).");
for (int i=0; i<senders.length; i++ ) {
}
}
}
- //clean up any cancelled keys
+ //clean up any canceled keys
if ( result ) try { selector.selectNow(); }catch (Exception ignore){}
return result;
}
/**
- * The relative or absolute pathname ot the file in which we write
+ * The relative or absolute pathname of the file in which we write
* our new information prior to renaming.
*/
protected String pathnameNew = pathname + ".new";
}
/**
- * Encodes hex octects into Base64.
+ * Encodes hex octets into Base64.
*
* @param binaryData Array containing binary data to encode.
* @return Base64-encoded data.
}
/**
- * Decodes Base64 data into octects
+ * Decodes Base64 data into octets
*
* @param base64DataBC Byte array containing Base64 data
* @param decodedDataCC The decoded data chars
public class DateTool {
/**
- * US locale - all HTTP dates are in english
+ * US locale - all HTTP dates are in English
*/
public final static Locale LOCALE_US = Locale.US;
/**
- * Ensures that all extension dependies are resolved for a WEB application
+ * Ensures that all extension dependencies are resolved for a WEB application
* are met. This class builds a master list of extensions available to an
- * applicaiton and then validates those extensions.
+ * application and then validates those extensions.
*
* See http://java.sun.com/j2se/1.4/docs/guide/extensions/spec.html for
* a detailed explanation of the extension mechanism in Java.
/**
- * Runtime validation of a Web Applicaiton.
+ * Runtime validation of a Web Application.
*
* This method uses JNDI to look up the resources located under a
* <code>DirContext</code>. It locates Web Application MANIFEST.MF
// If the application context is null it does not exist and
// therefore is not valid
if (dirContext == null) return false;
- // Find the Manifest for the Web Applicaiton
+ // Find the Manifest for the Web Application
InputStream inputStream = null;
try {
NamingEnumeration<Binding> wne =
* represented by any given <code>ManifestResource</code> objects
* is not met.
*
- * This method should also provide static validation of a Web Applicaiton
+ * This method should also provide static validation of a Web Application
* if provided with the necessary parameters.
*
* @param appName The name of the Application that will appear in the
while (rit.hasNext()) {
boolean found = false;
Extension requiredExt = rit.next();
- // check the applicaion itself for the extension
+ // check the application itself for the extension
if (availableExtensions != null) {
Iterator<Extension> ait = availableExtensions.iterator();
while (ait.hasNext()) {
*
* @param reader the reader to read from.
* @param writer the writer to write to.
- * @param buf the char array to use as a bufferx
+ * @param buf the char array to use as a buffer
*/
public static void flow( Reader reader, Writer writer, char[] buf )
throws IOException {
}
/**
- * Convienience method to check if this <code>ManifestResource</code>
+ * Convenience method to check if this <code>ManifestResource</code>
* has an requires extensions.
*
* @return true if required extensions are present
/**
* Construct a new map with the same mappings as the given map.
*
- * @param map Map whose contents are dupliated in the new map
+ * @param map Map whose contents are duplicated in the new map
*/
public ParameterMap(Map<K,V> map) {
/**
- * Convert a byte character value to hexidecimal digit value.
+ * Convert a byte character value to hexadecimal digit value.
*
* @param b the character value byte
*/
public class SchemaResolver implements EntityResolver {
/**
- * The disgester instance for which this class is the entity resolver.
+ * The digester instance for which this class is the entity resolver.
*/
protected Digester digester;
/**
* Create a new <code>EntityResolver</code> that will redirect
- * all remote dtds and schema to a locat destination.
+ * all remote dtds and schema to a local destination.
* @param digester The digester instance.
*/
public SchemaResolver(Digester digester) {
translate.put("r","hh:mm:ss a");
translate.put("R","HH:mm");
//There's no way to specify this with SimpleDateFormat
- //translate.put("s","seconds since ecpoch");
+ //translate.put("s","seconds since epoch");
translate.put("S","ss");
translate.put("t","\t");
translate.put("T","HH:mm:ss");
//translate.put("u","day of week ( 1-7 )");
//There's no way to specify this with SimpleDateFormat
- //translate.put("U","week in year with first sunday as first day...");
+ //translate.put("U","week in year with first Sunday as first day...");
translate.put("V","ww"); //I'm not sure this is always exactly the same
//There's no way to specify this with SimpleDateFormat
- //translate.put("W","week in year with first monday as first day...");
+ //translate.put("W","week in year with first Monday as first day...");
//There's no way to specify this with SimpleDateFormat
//translate.put("w","E");
/**
* Return whether the attribute name to look for when
- * performing conditional loggging. If null, every
+ * performing conditional logging. If null, every
* request is logged.
*/
public String getCondition() {
if (replace) {
/*
* For code that processes {, the behavior will be ... if I do
- * not enounter a closing } - then I ignore the {
+ * not encounter a closing } - then I ignore the {
*/
if ('{' == ch) {
StringBuilder name = new StringBuilder();
/**
- * List of current Coment connections.
+ * List of current Comet connections.
*/
protected List<Request> cometRequests =
Collections.synchronizedList(new ArrayList<Request>());
// begin event, and Comet mode is on
HttpSession session = request.getSession(true);
- // Track the conection for webapp reload
+ // Track the connection for webapp reload
cometRequests.add(request);
// Track the connection for session expiration