org.nuiton.widget
Class ApplicationMonitor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.nuiton.widget.ApplicationMonitor
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ApplicationMonitor
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
protected  class ApplicationMonitor.LogListener
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JTextArea allStreamsTextArea
           
static int DEFAULT_FOOTER_LINE
          nombre de ligne a conserver en fin des logs ex: stack trace si egal a -1 en meme temps que DEFAULT_HEADER_LINE alors tout le log est conservé
static java.lang.String DEFAULT_FROM_ADDRESS
           
static int DEFAULT_HEADER_LINE
          nombre de ligne a conserver au debut des logs ex: param de lancement si egal a -1 en meme temps que DEFAULT_FOOTER_LINE alors tout le log est conservé
static java.lang.String DEFAULT_LOGGING_SYSTEM
           
static java.lang.String DEFAULT_SMTP_SERVER
           
static java.lang.String DEFAULT_TO_ADDRESS
           
protected  javax.swing.JTextArea errorStreamTextArea
           
protected  java.lang.String from
           
protected  javax.swing.JPanel jPanel
           
protected  javax.swing.JPanel jPanel1
           
protected  javax.swing.JPanel jPanel2
           
protected  javax.swing.JPanel jPanel2bis
           
protected  javax.swing.JPanel jPanel3
           
protected  javax.swing.JPanel jPanel4
           
protected  javax.swing.JPanel jPanel5
           
protected  javax.swing.JPanel jPanel6
           
protected  javax.swing.JScrollPane jScrollPane
           
protected  javax.swing.JScrollPane jScrollPane1
           
protected  javax.swing.JScrollPane jScrollPane2
           
protected  javax.swing.JScrollPane jScrollPanebis
           
protected  javax.swing.JTabbedPane jTabbedPane
           
protected  java.lang.String loggingSystem
           
protected  ApplicationMonitor.LogListener logListener
           
protected  javax.swing.JTextArea logStreamTextArea
           
protected  javax.swing.JTextArea outputStreamTextArea
           
protected  javax.swing.JButton resetButton
           
protected  javax.swing.JButton sendByEmailButton
           
protected  java.lang.String smtpServer
           
protected  StatusBar statusBar
           
protected  java.io.PrintStream stderr
           
protected  java.io.PrintStream stdout
           
protected  java.lang.String to
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ApplicationMonitor()
          This is the default constructor
ApplicationMonitor(java.lang.String loggingSystem)
           
ApplicationMonitor(java.lang.String loggingSystem, java.lang.String smtpServer, java.lang.String from, java.lang.String to)
           
 
Method Summary
protected  void ensureLine(javax.swing.JTextArea target)
          ensure that the textarea does'nt have more than necessary line
protected  void finalize()
           
protected  javax.swing.JTextArea getAllStreamsTextArea()
          This method initializes allStreamsTextArea
protected  javax.swing.JTextArea getErrorStreamTextArea()
          This method initializes jTextArea1
protected  javax.swing.JPanel getJPanel()
          This method initializes jPanel
protected  javax.swing.JPanel getJPanel1()
          This method initializes jPanel1
protected  javax.swing.JPanel getJPanel2()
          This method initializes jPanel2
protected  javax.swing.JPanel getJPanel2bis()
          This method initializes jPanel2bis
protected  javax.swing.JPanel getJPanel3()
          This method initializes jPanel3
protected  javax.swing.JPanel getJPanel4()
          This method initializes jPanel4
protected  javax.swing.JPanel getJPanel5()
          This method initializes jPanel5
protected  javax.swing.JPanel getJPanel6()
          This method initializes jPanel6
protected  javax.swing.JScrollPane getJScrollPane()
          This method initializes jScrollPane
protected  javax.swing.JScrollPane getJScrollPane1()
          This method initializes jScrollPane1
protected  javax.swing.JScrollPane getJScrollPane2()
          This method initializes jScrollPane2
protected  javax.swing.JScrollPane getJScrollPanebis()
          This method initializes jScrollPanebis
protected  javax.swing.JTabbedPane getJTabbedPane()
          This method initializes jTabbedPane
protected  javax.swing.JTextArea getLogStreamTextArea()
          This method initializes jTextArea
protected  javax.swing.JTextArea getOutputStreamTextArea()
          This method initializes jTextArea
protected  javax.swing.JButton getResetButton()
          This method initializes jButton
protected  javax.swing.JButton getSendByEmailButton()
          This method initializes jButton1
protected  StatusBar getStatusBar()
           
protected  void initialize()
           
protected  void initializeLoggingHandler()
          Set a logging handler up
protected  void initializeRedirect()
          Sets new OutputStreams for System.out and System.err
protected  void initializeUI()
          This method initializes UI
static void main(java.lang.String[] args)
           
 void resetConsoleContent()
           
protected  void send(java.lang.String smtpServer, java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String body)
          Send an email using the given informations (stmpServer, toAddress, fromAddress, subject and body).
 void sendConsoleContentByMail()
           
 void setEmailFrom(java.lang.String from)
           
 void setEmailTo(java.lang.String to)
           
 void setSmtpServer(java.lang.String smtpServer)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_HEADER_LINE

public static int DEFAULT_HEADER_LINE
nombre de ligne a conserver au debut des logs ex: param de lancement si egal a -1 en meme temps que DEFAULT_FOOTER_LINE alors tout le log est conservé


DEFAULT_FOOTER_LINE

public static int DEFAULT_FOOTER_LINE
nombre de ligne a conserver en fin des logs ex: stack trace si egal a -1 en meme temps que DEFAULT_HEADER_LINE alors tout le log est conservé


DEFAULT_LOGGING_SYSTEM

public static final java.lang.String DEFAULT_LOGGING_SYSTEM
See Also:
Constant Field Values

DEFAULT_SMTP_SERVER

public static final java.lang.String DEFAULT_SMTP_SERVER
See Also:
Constant Field Values

DEFAULT_FROM_ADDRESS

public static final java.lang.String DEFAULT_FROM_ADDRESS
See Also:
Constant Field Values

DEFAULT_TO_ADDRESS

public static final java.lang.String DEFAULT_TO_ADDRESS
See Also:
Constant Field Values

loggingSystem

protected java.lang.String loggingSystem

smtpServer

protected java.lang.String smtpServer

to

protected java.lang.String to

from

protected java.lang.String from

stdout

protected java.io.PrintStream stdout

stderr

protected java.io.PrintStream stderr

logListener

protected ApplicationMonitor.LogListener logListener

jPanel

protected javax.swing.JPanel jPanel

jPanel1

protected javax.swing.JPanel jPanel1

resetButton

protected javax.swing.JButton resetButton

sendByEmailButton

protected javax.swing.JButton sendByEmailButton

jTabbedPane

protected javax.swing.JTabbedPane jTabbedPane

jPanel2

protected javax.swing.JPanel jPanel2

jPanel2bis

protected javax.swing.JPanel jPanel2bis

jPanel3

protected javax.swing.JPanel jPanel3

jScrollPane

protected javax.swing.JScrollPane jScrollPane

jScrollPanebis

protected javax.swing.JScrollPane jScrollPanebis

outputStreamTextArea

protected javax.swing.JTextArea outputStreamTextArea

allStreamsTextArea

protected javax.swing.JTextArea allStreamsTextArea

jScrollPane1

protected javax.swing.JScrollPane jScrollPane1

errorStreamTextArea

protected javax.swing.JTextArea errorStreamTextArea

statusBar

protected StatusBar statusBar

jPanel4

protected javax.swing.JPanel jPanel4

jScrollPane2

protected javax.swing.JScrollPane jScrollPane2

logStreamTextArea

protected javax.swing.JTextArea logStreamTextArea

jPanel5

protected javax.swing.JPanel jPanel5

jPanel6

protected javax.swing.JPanel jPanel6
Constructor Detail

ApplicationMonitor

public ApplicationMonitor()
This is the default constructor


ApplicationMonitor

public ApplicationMonitor(java.lang.String loggingSystem)

ApplicationMonitor

public ApplicationMonitor(java.lang.String loggingSystem,
                          java.lang.String smtpServer,
                          java.lang.String from,
                          java.lang.String to)
Method Detail

resetConsoleContent

public void resetConsoleContent()

sendConsoleContentByMail

public void sendConsoleContentByMail()

setSmtpServer

public void setSmtpServer(java.lang.String smtpServer)
Parameters:
smtpServer - the smtpServer to set

setEmailTo

public void setEmailTo(java.lang.String to)
Parameters:
to - the to to set

setEmailFrom

public void setEmailFrom(java.lang.String from)
Parameters:
from - the from to set

initialize

protected void initialize()

initializeRedirect

protected void initializeRedirect()
Sets new OutputStreams for System.out and System.err


finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

initializeLoggingHandler

protected void initializeLoggingHandler()
Set a logging handler up


send

protected void send(java.lang.String smtpServer,
                    java.lang.String to,
                    java.lang.String from,
                    java.lang.String subject,
                    java.lang.String body)
             throws javax.mail.internet.AddressException,
                    javax.mail.MessagingException
Send an email using the given informations (stmpServer, toAddress, fromAddress, subject and body).

Parameters:
smtpServer -
to -
from -
subject -
body -
Throws:
javax.mail.MessagingException
javax.mail.internet.AddressException

initializeUI

protected void initializeUI()
This method initializes UI


getJPanel

protected javax.swing.JPanel getJPanel()
This method initializes jPanel

Returns:
javax.swing.JPanel

getJPanel1

protected javax.swing.JPanel getJPanel1()
This method initializes jPanel1

Returns:
javax.swing.JPanel

getResetButton

protected javax.swing.JButton getResetButton()
This method initializes jButton

Returns:
javax.swing.JButton

getSendByEmailButton

protected javax.swing.JButton getSendByEmailButton()
This method initializes jButton1

Returns:
javax.swing.JButton

getJTabbedPane

protected javax.swing.JTabbedPane getJTabbedPane()
This method initializes jTabbedPane

Returns:
javax.swing.JTabbedPane

getJPanel2bis

protected javax.swing.JPanel getJPanel2bis()
This method initializes jPanel2bis

Returns:
javax.swing.JPanel

getJPanel2

protected javax.swing.JPanel getJPanel2()
This method initializes jPanel2

Returns:
javax.swing.JPanel

getJPanel3

protected javax.swing.JPanel getJPanel3()
This method initializes jPanel3

Returns:
javax.swing.JPanel

getJScrollPanebis

protected javax.swing.JScrollPane getJScrollPanebis()
This method initializes jScrollPanebis

Returns:
javax.swing.JScrollPane

getJScrollPane

protected javax.swing.JScrollPane getJScrollPane()
This method initializes jScrollPane

Returns:
javax.swing.JScrollPane

getAllStreamsTextArea

protected javax.swing.JTextArea getAllStreamsTextArea()
This method initializes allStreamsTextArea

Returns:
javax.swing.JTextArea

getOutputStreamTextArea

protected javax.swing.JTextArea getOutputStreamTextArea()
This method initializes jTextArea

Returns:
javax.swing.JTextArea

getJScrollPane1

protected javax.swing.JScrollPane getJScrollPane1()
This method initializes jScrollPane1

Returns:
javax.swing.JScrollPane

getErrorStreamTextArea

protected javax.swing.JTextArea getErrorStreamTextArea()
This method initializes jTextArea1

Returns:
javax.swing.JTextArea

getJPanel4

protected javax.swing.JPanel getJPanel4()
This method initializes jPanel4

Returns:
javax.swing.JPanel

getJScrollPane2

protected javax.swing.JScrollPane getJScrollPane2()
This method initializes jScrollPane2

Returns:
javax.swing.JScrollPane

getLogStreamTextArea

protected javax.swing.JTextArea getLogStreamTextArea()
This method initializes jTextArea

Returns:
javax.swing.JTextArea

getJPanel5

protected javax.swing.JPanel getJPanel5()
This method initializes jPanel5

Returns:
javax.swing.JPanel

getJPanel6

protected javax.swing.JPanel getJPanel6()
This method initializes jPanel6

Returns:
javax.swing.JPanel

getStatusBar

protected StatusBar getStatusBar()

ensureLine

protected void ensureLine(javax.swing.JTextArea target)
ensure that the textarea does'nt have more than necessary line

Parameters:
target -

main

public static void main(java.lang.String[] args)


Copyright © 2004-2009 CodeLutin. All Rights Reserved.