001: /*
002: * CoadunationLib: The coaduntion implementation library.
003: * Copyright (C) 2006 Rift IT Contracting
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
018: *
019: * ThreadInfo.java
020: *
021: * The information about a single thread running in coadunation.
022: */
023:
024: package com.rift.coad.lib.thread;
025:
026: // coadunation imports
027: import com.rift.coad.lib.security.UserSession;
028:
029: /**
030: * The information about a single thread running in coadunation.
031: *
032: * @author Brett Chaldecott
033: */
034: public class ThreadInfo {
035:
036: // the classes member variables
037: private long threadId = 0;
038: private Class threadClass = null;
039: private UserSession user = null;
040: private Thread.State state = null;
041: private String info = null;
042:
043: /**
044: * Creates a new instance of ThreadInfo
045: *
046: * @param threadId The id of the thread this object represents.
047: * @param threadClass The reference to the thread class.
048: * @param user The user object.
049: * @param state The state of this thread.
050: */
051: public ThreadInfo(long threadId, Class threadClass,
052: UserSession user, Thread.State state, String info) {
053: this .threadId = threadId;
054: this .threadClass = threadClass;
055: this .user = user;
056: this .state = state;
057: this .info = info;
058: }
059:
060: /**
061: * The getter method for the thread id.
062: *
063: * @return The id of the thread contained in a long value.
064: */
065: public long getThreadId() {
066: return threadId;
067: }
068:
069: /**
070: * The getter method for the thread class object.
071: *
072: * @return The reference to the thread class.
073: */
074: public Class getThreadClass() {
075: return threadClass;
076: }
077:
078: /**
079: * This method returns the user object reference for this thread.
080: *
081: * @return The reference to the user object.
082: */
083: public UserSession getUser() {
084: return user;
085: }
086:
087: /**
088: * This method returns the state of the thread that this object contains
089: * information for.
090: *
091: * @return The reference to the current state.
092: */
093: public Thread.State getState() {
094: return state;
095: }
096:
097: /**
098: * The information about this thread as provided by the thread.
099: *
100: * @return A string containing the information about this thread.
101: */
102: public String getInfo() {
103: return info;
104: }
105: }
|