Go to the documentation of this file.
41 package com.sun.jmx.examples.scandir;
48 import java.io.FileOutputStream;
49 import java.io.IOException;
50 import java.io.OutputStream;
51 import java.util.Collections;
52 import java.util.LinkedList;
53 import java.util.List;
54 import java.util.logging.Logger;
55 import javax.management.MBeanNotificationInfo;
56 import javax.management.MBeanRegistration;
57 import javax.management.MBeanServer;
58 import javax.management.Notification;
59 import javax.management.NotificationBroadcasterSupport;
60 import javax.management.ObjectName;
61 import javax.xml.bind.JAXBException;
93 private static final Logger
LOG =
150 Collections.synchronizedList(
new LinkedList<ResultRecord>() {
153 while (max > 0 &&
size() >= max) {
247 }
catch (Exception x) {
248 LOG.finest(
"Failed to close log properly: "+x);
272 final OutputStream newStream;
274 if ((force==
false) && (
logCount < maxRecords))
276 final OutputStream oldStream =
logStream;
281 if (oldStream !=
null) {
287 newStream = (newFile==
null)?
null:
new FileOutputStream(newFile,
true);
329 synchronized (
this) {
375 getNextSeqNumber(),
"memory log cleared"));
396 if (before==
false && after==
true)
399 getNextSeqNumber(),
"memory log capacity reached"));
407 final String basename;
408 final long maxRecords;
409 synchronized (
this) {
416 final OutputStream stream =
420 if (stream ==
null)
return;
422 synchronized (
this) {
428 }
catch (JAXBException x) {
429 final IllegalArgumentException iae =
430 new IllegalArgumentException(
"bad record",x);
431 LOG.finest(
"Failed to log record: "+x);
444 "com.sun.jmx.examples.scandir.log.file.switched";
452 "com.sun.jmx.examples.scandir.log.memory.full";
460 "com.sun.jmx.examples.scandir.log.memory.cleared";
471 return new MBeanNotificationInfo[] {
472 new MBeanNotificationInfo(
new String[] {
474 Notification.class.getName(),
475 "Emitted when the log file is switched")
477 new MBeanNotificationInfo(
new String[] {
479 Notification.class.getName(),
480 "Emitted when the memory log capacity is reached")
482 new MBeanNotificationInfo(
new String[] {
484 Notification.class.getName(),
485 "Emitted when the memory log is cleared")
492 synchronized (
this) {
493 if (
logFile ==
null)
return null;
494 if (absolute)
return logFile.getAbsolutePath();
503 if (logConfigBean ==
null)
504 throw new IllegalArgumentException(
"logConfigBean is null");
505 synchronized (
this) {
511 if ((filename !=
null && !filename.equals(logname))
512 || (filename ==
null && logname !=
null)) {
volatile long fileCapacity
String getLogFileName(boolean absolute)
volatile boolean memCapacityReached
File createNewLogFile(String basename)
void postRegister(Boolean registrationDone)
static final String LOG_FILE_CHANGED
static final ObjectName makeSingletonName(Class clazz)
void logToFile(ResultRecord record)
long getLogFileMaxRecords()
int getMemoryMaxRecords()
MBeanNotificationInfo[] getNotificationInfo()
void log(ResultRecord record)
long getLogFileCapacity()
ObjectName preRegister(MBeanServer server, ObjectName name)
static File createNewXmlFile(String basename)
void logToMemory(ResultRecord record)
void setLogFileCapacity(long maxRecords)
volatile ResultLogConfig config
static void write(ScanManagerConfig bean, OutputStream os, boolean fragment)
OutputStream checkLogFile(String basename, long maxRecords, boolean force)
void setMemoryLogCapacity(int maxRecords)
void setMemoryMaxRecords(int memoryMaxRecords)
void setConfig(ResultLogConfig logConfigBean)
Font2DTest To run then you should either specify the complete path to the commands or update your PATH environment variable as described in the installation instructions for the load Font2DTest html If you wish to modify any of the source you may want to extract the contents of the Font2DTest jar file by executing this the browser plugin viewer needs following permissions given in order to run but some of its features will be limited To enable all please add these permissions with policytool Introduction Font2DTest is an encompassing application for testing various fonts found on the user s system A number of controls are available to change many attributes of the current font including size
int getMemoryLogCapacity()
This document describes some hints and requirements for general development on the CrossfireEditor If you plan to make changes to the editor code or setup please read the following and keep it in derived from a basic editor application called Gridder by Pasi Ker�nen so please communicate with best through the cf devel mailing before considering any fundamental changes About code DO NOT USE TABS No matter what Java development platform you are please configure insert indent Tabs are displayed totally different in every editor and there are millions of different editors out there The insertion of tabs in the source code is messing up the syntax formatting in a way that is UNREPAIRABLE Apart from please keep code indentation accurate This is not just good it helps to keep code readable and in that way dramatically decreases the chance for overlooked bugs Everyone is welcomed to correct indentation errors wherever they are spotted Before you start to do this please double check that your editor is really configured to insert spaces Line feeds may be checked in either in windows or in unix linux style All reasonable text and java editors can deal with both linefeed formats Converting line feeds is but in this case please make sure that only linefeed characters are changed and nothing else is affected Due to the platform independent nature of the editor has the potential to run on almost any given operating system the build process differs greatly between systems as well as java environments In the several people have attempted to add build scripts along with structural changes to optimize the setup on one particular system environment which has led to conflict Please do *not *attempt to change the structure or any directories for the mere purpose of improving a build process or performance in a java environment Build scripts may be placed in the root it would be especially fine if it is just one or two files but the latter is not required Please excuse me for placing such restriction I and many users of the editor greatly appreciate build scripts We just had some real troubles over this issue in the past and I don t want to have them repeated the editor has relatively high performance requirements I ve spent a lot of extra work to keep everything as fast and memory efficient as possible when you add new data fields or calculations in the archetype please make sure they are as efficient as possible and worth both the time and space they consume Now don t be afraid too much No development would be possible without adding calculations and data at all Just bear in mind unlike for many other open source performance does make a difference for the CrossfireEditor The for as many systems as possible In case you are unexperienced with java and note that the graphics look different on every and with every font They also have different sizes proportions and behave different A seemingly trivial and effectless change can wreck havoc for the same GUI run on another system please don t be totally afraid of just keep it in mind Nobody is gonna eat you alive when your code causes a GUI bug The best way to deal with it is to test on different systems Another good thing is to design all GUIs with care and avoid fixed sizes like wherever you can You might notice that the basic structure of the code obeys the model view controller scheme Too bad it is halfway messed up and but please try to stick with it as good as you can Don t make it worse For the record
static final String MEMORY_LOG_MAX_CAPACITY
static synchronized long getNextSeqNumber()
void newLogFile(String logname, long maxRecord)
static final String MEMORY_LOG_CLEARED
ResultRecord[] getMemoryLog()
volatile OutputStream logStream
void setLogFileMaxRecords(long logFileMaxRecords)
static final ObjectName RESULT_LOG_MANAGER_NAME
final List< ResultRecord > memoryLog
in the editor and run the same with Tools Run menu You will see an alert box with the message world In addition to being a simple script editor scriptpad can be used to connect to a JMX MBean server("Tools->JMX Connect" menu). User can specify JMX hostname and port. After connecting
ResultLogConfig getConfig()
void setLogFileName(String logFileName)