本文整理匯總了Java中org.mortbay.log.Log.isDebugEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.isDebugEnabled方法的具體用法?Java Log.isDebugEnabled怎麽用?Java Log.isDebugEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.mortbay.log.Log
的用法示例。
在下文中一共展示了Log.isDebugEnabled方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureClassLoader
import org.mortbay.log.Log; //導入方法依賴的package包/類
/**
* Set up the classloader for the webapp, using the various parts of the Maven project
*
* @see org.mortbay.jetty.webapp.Configuration#configureClassLoader()
*/
public void configureClassLoader() throws Exception {
if (classPathFiles != null) {
Log.debug("Setting up classpath ...");
//put the classes dir and all dependencies into the classpath
for (File classPathFile : classPathFiles) {
((WebAppClassLoader) getWebAppContext().getClassLoader()).addClassPath(
classPathFile.getCanonicalPath());
}
if (Log.isDebugEnabled()) {
Log.debug("Classpath = " + LazyList.array2List(
((URLClassLoader) getWebAppContext().getClassLoader()).getURLs()));
}
} else {
super.configureClassLoader();
}
}
示例2: Session
import org.mortbay.log.Log; //導入方法依賴的package包/類
/**
* Session from a request.
*
* @param request
*/
protected Session (HttpServletRequest request)
{
super(request);
_data = new SessionData(_clusterId);
_data.setMaxIdleMs(_dftMaxIdleSecs*1000);
_data.setContextPath(_context.getContextPath());
_data.setVirtualHost(getVirtualHost(_context));
_data.setExpiryTime(_maxIdleMs < 0 ? 0 : (System.currentTimeMillis() + _maxIdleMs));
_data.setCookieSet(0);
if (_data.getAttributeMap()==null)
newAttributeMap();
_values=_data.getAttributeMap();
if (Log.isDebugEnabled()) Log.debug("New Session from request, "+_data.toStringExtended());
}
示例3: complete
import org.mortbay.log.Log; //導入方法依賴的package包/類
/**
* Exit from session
*
* If the session attributes changed then always write the session
* to the cloud.
*
* If just the session access time changed, we don't always write out the
* session, because the gigaspace will serialize the unchanged sesssion
* attributes. To save on serialization overheads, we only write out the
* session when only the access time has changed if the time at which we
* last saved the session exceeds the chosen save interval.
*
* @see org.mortbay.jetty.servlet.AbstractSessionManager.Session#complete()
*/
protected void complete()
{
super.complete();
try
{
if (_dirty || (_data._accessed - _data._lastSaved) >= (_savePeriodMs))
{
_data.setLastSaved(System.currentTimeMillis());
willPassivate();
update(_data);
didActivate();
if (Log.isDebugEnabled()) Log.debug("Dirty="+_dirty+", accessed-saved="+_data._accessed +"-"+ _data._lastSaved+", savePeriodMs="+_savePeriodMs);
}
}
catch (Exception e)
{
Log.warn("Problem persisting changed session data id="+getId(), e);
}
finally
{
_dirty=false;
}
}
示例4: addSession
import org.mortbay.log.Log; //導入方法依賴的package包/類
public void addSession(HttpSession session)
{
if (session == null)
return;
synchronized (_sessionIds)
{
if (session instanceof GigaSessionManager.Session)
{
String id = ((GigaSessionManager.Session)session).getClusterId();
try
{
Id theId = new Id(id);
add(theId);
_sessionIds.add(theId);
if (Log.isDebugEnabled()) Log.debug("Added id "+id);
}
catch (Exception e)
{
Log.warn("Problem storing session id="+id, e);
}
}
else
throw new IllegalStateException ("Session is not a Gigaspaces session");
}
}
示例5: removeSession
import org.mortbay.log.Log; //導入方法依賴的package包/類
public void removeSession (String id)
{
if (id == null)
return;
synchronized (_sessionIds)
{
if (Log.isDebugEnabled())
Log.debug("Removing session id="+id);
try
{
Id theId = new Id(id);
_sessionIds.remove(theId);
delete(theId);
}
catch (Exception e)
{
Log.warn("Problem removing session id="+id, e);
}
}
}
示例6: chmod
import org.mortbay.log.Log; //導入方法依賴的package包/類
/**
* Change the permissions on a file / directory, recursively, if
* needed.
* @param filename name of the file whose permissions are to change
* @param perm permission string
* @param recursive true, if permissions should be changed recursively
* @return the exit code from the command.
* @throws IOException
* @throws InterruptedException
*/
public static int chmod(String filename, String perm, boolean recursive)
throws IOException, InterruptedException {
StringBuffer cmdBuf = new StringBuffer();
cmdBuf.append("chmod ");
if (recursive) {
cmdBuf.append("-R ");
}
cmdBuf.append(perm).append(" ");
cmdBuf.append(filename);
String[] shellCmd = {"bash", "-c" ,cmdBuf.toString()};
ShellCommandExecutor shExec = new ShellCommandExecutor(shellCmd);
try {
shExec.execute();
}catch(IOException e) {
if(Log.isDebugEnabled()) {
Log.debug("Error while changing permission : " + filename
+" Exception: " + StringUtils.stringifyException(e));
}
}
return shExec.getExitCode();
}
示例7: bind
import org.mortbay.log.Log; //導入方法依賴的package包/類
@Override
public void bind(InetSocketAddress addr, int backlog) throws IOException
{
this._addr = addr;
// check if there is already a connector listening
Connector[] connectors = _server.getConnectors();
if (connectors != null)
{
for (int i = 0; i < connectors.length; i++)
{
if (connectors[i].getPort() == addr.getPort())
{
if (Log.isDebugEnabled()) Log.debug("server already bound to port " + addr.getPort() + ", no need to rebind");
return;
}
}
}
if (_executor != null && _server.getThreadPool() == null)
{
if (Log.isDebugEnabled()) Log.debug("using given Executor for server thread pool");
_server.setThreadPool(new ThreadPoolExecutorAdapter(_executor));
}
SelectChannelConnector connector = new SelectChannelConnector();
connector.setAcceptors(1);
connector.setPort(addr.getPort());
connector.setHost(addr.getHostName());
_server.addConnector(connector);
_connectors.put(addr.getHostName() + addr.getPort(), connector);
}
示例8: setScavengePeriod
import org.mortbay.log.Log; //導入方法依賴的package包/類
public void setScavengePeriod(int seconds)
{
if (seconds<=0)
seconds=60;
int old_period=_scavengePeriodMs;
int period=seconds*1000;
_scavengePeriodMs=period;
//add a bit of variability into the scavenge time so that not all
//contexts with the same scavenge time sync up
int tenPercent = _scavengePeriodMs/10;
if ((System.currentTimeMillis()%2) == 0)
_scavengePeriodMs += tenPercent;
if (Log.isDebugEnabled()) Log.debug("GigspacesSessionScavenger scavenging every "+_scavengePeriodMs+" ms");
if (_timer!=null && (period!=old_period || _task==null))
{
synchronized (this)
{
if (_task!=null)
_task.cancel();
_task = new TimerTask()
{
public void run()
{
scavenge();
}
};
_timer.schedule(_task,_scavengePeriodMs,_scavengePeriodMs);
}
}
}
示例9: exists
import org.mortbay.log.Log; //導入方法依賴的package包/類
protected boolean exists (Id id)
throws Exception
{
Id idFromSpace = (Id)_space.readIfExists(id, getWaitMs());
if (Log.isDebugEnabled()) Log.debug("Id="+id+(idFromSpace==null?"does not exist":"exists"));
if (idFromSpace==null)
return false;
return true;
}
示例10: timeout
import org.mortbay.log.Log; //導入方法依賴的package包/類
protected void timeout() throws IllegalStateException
{
if (Log.isDebugEnabled()) Log.debug("Timing out session id="+getClusterId());
super.timeout();
}
示例11: getSession
import org.mortbay.log.Log; //導入方法依賴的package包/類
/**
* Get a session matching the id.
*
* Look in the grid to see if such a session exists, as it may have moved from
* another node.
*
* @see org.mortbay.jetty.servlet.AbstractSessionManager#getSession(java.lang.String)
*/
public Session getSession(String idInCluster)
{
synchronized (this)
{
try
{
//Ask the space for the session. This might incur serialization:
//if we have no localcache, OR the localcache has to fetch the session
//because of a cache miss OR the localcache is set to pull mode (where it
//checks for changes to an object when that object is requested).
//Alternatively, if the localcache is set to push mode, the cloud will
//keep the localcache up-to-date with object changes in the background,
//so serialization is occuring beyond our control.
//TODO consider using the jdbc approach, were we only ask the cloud
//intermittently for the session.
SessionData template = new SessionData();
template.setId(idInCluster);
template.setContextPath(_context.getContextPath());
template.setVirtualHost(getVirtualHost(_context));
SessionData data = fetch (template);
Session session = null;
if (data == null)
{
//No session in cloud with matching id and context path.
session=null;
if (Log.isDebugEnabled()) Log.debug("No session matching id="+idInCluster);
}
else
{
Session oldSession = (Session)_sessions.get(idInCluster);
//if we had no prior session, or the session from the cloud has been
//more recently updated than our copy in memory, we should use it
//instead
if ((oldSession == null) || (data.getAccessed() > oldSession._data.getAccessed()))
{
session = new Session(data);
_sessions.put(idInCluster, session);
session.didActivate();
if (Log.isDebugEnabled()) Log.debug("Refreshed in-memory Session with "+data.toStringExtended());
}
else
{
if (Log.isDebugEnabled()) Log.debug("Not updating session "+idInCluster+", in-memory session is as fresh or fresher");
session = oldSession;
}
}
return session;
}
catch (Exception e)
{
Log.warn("Unable to load session from database", e);
return null;
}
}
}
示例12: update
import org.mortbay.log.Log; //導入方法依賴的package包/類
protected void update (SessionData data)
throws Exception
{
_space.write(data);
if (Log.isDebugEnabled()) Log.debug("Wrote session "+data.toStringExtended());
}
示例13: delete
import org.mortbay.log.Log; //導入方法依賴的package包/類
protected void delete (Id id)
throws Exception
{
_space.takeIfExists(id, getWaitMs());
if (Log.isDebugEnabled()) Log.debug ("Deleted id from space: id="+id);
}
示例14: monitorMeta
import org.mortbay.log.Log; //導入方法依賴的package包/類
public void monitorMeta(Client client, Message message)
{
if (Log.isDebugEnabled())
Log.debug(message.toString());
}