exfex-cvs-commit Mailing List for Extended Form of examination (Page 12)
Status: Planning
Brought to you by:
mstsxfx
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(93) |
Oct
(134) |
Nov
(29) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(20) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
|
Dec
|
From: Michal H. <ms...@us...> - 2005-09-18 18:51:44
|
Update of /cvsroot/exfex/exfex/source/exfex/common/pluginsystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9548/source/exfex/common/pluginsystem Modified Files: DependencyMap.java Log Message: cloneable and new methods getSources, getDepended Index: DependencyMap.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/DependencyMap.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DependencyMap.java 15 Sep 2005 18:11:02 -0000 1.9 --- DependencyMap.java 18 Sep 2005 18:51:32 -0000 1.10 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.10 2005/09/18 18:51:32 mstsxfx + * cloneable and new methods getSources, getDepended + * * Revision 1.9 2005/09/15 18:11:02 mstsxfx * documentation corrected *************** *** 19,24 **** package exfex.common.pluginsystem; ! import java.util.*; ! import exfex.common.logging.*; /** Source of dependency class. --- 22,34 ---- package exfex.common.pluginsystem; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.LinkedList; ! import java.util.List; ! import java.util.Map; ! import java.util.Set; ! ! import exfex.common.logging.ILogger; ! import exfex.common.logging.LogManager; /** Source of dependency class. *************** *** 40,43 **** --- 50,58 ---- * plugins (can be found in DependencyMap) should be considered for purging, * because it was last implementator of this type and. + * <br> + * If you need to get list of all implementators, call getImplementators method. + * <br> + * Class is clonebale, so if you need to obtain deep copy of the map, use + * clone method. * <p> * NOTE: Class is not synchronized, so it can be used only from synchronized *************** *** 46,52 **** * <pre> * - * TODO use loggmanager - * * Changes: * 6.8.2005 msts - created * </pre> --- 61,66 ---- * <pre> * * Changes: + * 18.9.2005 msts - cloneable implementation * 6.8.2005 msts - created * </pre> *************** *** 54,58 **** * @author msts */ ! class DependencySource { /** List of implementators. --- 68,72 ---- * @author msts */ ! class DependencySource implements Cloneable { /** List of implementators. *************** *** 87,90 **** --- 101,118 ---- } + /** Initializating constructor. + * + * Sets fields values from parameters (uses shallow copy). Caller + * should set parameters to cloned versions if needs deep copy. + * + * @param source Source of dependency type plugin. + * @param implList List of implementators. + */ + protected DependencySource(IPlugin source, PluginList implList) + { + this.source=source; + this.implList=implList; + } + /** Insert implementator to the DependencySource. * *************** *** 174,178 **** public boolean compatible(IPlugin plg)//{{{ { ! if(PluginList.isCompatible(source,plg)) return true; return false; --- 202,206 ---- public boolean compatible(IPlugin plg)//{{{ { ! if(PluginList.areCompatibles(source,plg)) return true; return false; *************** *** 194,197 **** --- 222,239 ---- } + /** Returns list of all Implementators. + * + * Calls implList.toList method to get list of implementators. This + * cause, that client can change list with no effect to the internal + * list. + * + * @see PluginList#toList + * @return List of plugins that are source of dependency. + */ + public List<IPlugin> getImplementators()//{{{ + { + return implList.toList(); + }//}}} + /** Find out if plugin is in this DependencySource. * *************** *** 208,213 **** --- 250,276 ---- return implList.searchExact(plugin)==null ? false : true; } + + @Override public String toString() + { + return new String("Dependency Source{"+implList.toString()+"}"); + } + + /** Deep copy maker. + * Creates deep copy of this object. Source field is copied as referency + * because it can be shared (we don't want to create more instances of + * one plugin). Implementation list is deep copied (uses PluginList + * clone method). + * + * @return New instance of DependencySource class. + */ + @Override public Object clone() + { + // creates new DependencySource object and calls its protected + // constructor with shallow source and deep implList copies. + return new DependencySource(source, (PluginList)implList.clone()); + } } + /** Class to keep dependency relations. * *************** *** 243,253 **** * (whith the same type and name) use changeImplementator method. This can be * used for example when conflicting plugin replaced and old plugin. ! * <li>TODO: If you, for any reason, need to find out dependencies (sources of ! * dependecies) of given plugin, use getDependencies method. ! * <li>On the other hand, if you need all depended plugins on given one, use ! * getDepended method. * </ul> ! * NOTE: This class is not synchronized, so it should be called from ! * safe (or synchronized) environment. * * @see exfex.common.pluginsystem.DependencySource --- 306,316 ---- * (whith the same type and name) use changeImplementator method. This can be * used for example when conflicting plugin replaced and old plugin. ! * <li>if you need all depended plugins on given one, use getDepended method. ! * <li>if you need to get all dependency sources, call getSources method. ! * <li>Class is clonebale, so if you need to obtain deep copy of the map, use ! * clone method. * </ul> ! * NOTE: This class is not synchronized, so it should be called from safe ! * (or synchronized) environment. * * @see exfex.common.pluginsystem.DependencySource *************** *** 259,263 **** * * Changes: ! * 9.8.2005 msts - created * </pre> */ --- 322,332 ---- * * Changes: ! * ! * TODO: serialization ! * ! * 18.9.2005 msts - cloneable implementation ! * consolidation method for plugin conflict handling ! * getSources and getDepended methods add ! * 9.8.2005 msts - created * </pre> */ *************** *** 272,280 **** // Creates map with initial capacity 100 // TODO get value from setting ! map=new Hashtable<DependencySource, PluginList>(100); } /** Creates dependency relation. * * Two situation can happen in this method: * <ul> --- 341,379 ---- // Creates map with initial capacity 100 // TODO get value from setting ! map=new Hashtable<DependencySource, PluginList>(100) ! { ! static final private long serialVersionUID = 1L; ! ! /** Creates deep copy of the map. */ ! @Override public Object clone() ! { ! // clone each key, vlaue pair from table ! // uses clone method for both key and value ! Hashtable<DependencySource, PluginList> result=new Hashtable<DependencySource, PluginList>(); ! Set<Map.Entry<DependencySource, PluginList>> pairs=this.entrySet(); ! for(Map.Entry<DependencySource, PluginList> e : pairs) ! result.put((DependencySource)e.getKey().clone(),(PluginList)e.getValue().clone()); ! ! return (Object)result; ! } ! }; ! } ! ! /** Initialization constructor. ! * ! * Sets mao field to the given parameter (uses shallow copy). Caller ! * should set parameters to cloned versions if needs deep copy. ! * ! * @param map Map to use to initialide map field. ! */ ! protected DependencyMap(Hashtable<DependencySource, PluginList> map) ! { ! this.map=map; } /** Creates dependency relation. * + * Inserts pair (source, depended) to the map. + * <p> * Two situation can happen in this method: * <ul> *************** *** 282,296 **** * source plugin has never been add to the map. So we create * new DependencySource object from source plugin and linked list ! * with one member depended. This is initialization of dependency * relation. * <li> ! * there already exist DependencySource object compatible with source * plugin. We will call DependencySource.put on it and append it's ! * dependency list (value in map) with depended * </ul> * * @param source Source of the dependency. * @param depended Depended plugin on source. - * @see DependencySource#put */ public void addDependency(IPlugin source, IPlugin depended)//{{{ --- 381,397 ---- * source plugin has never been add to the map. So we create * new DependencySource object from source plugin and linked list ! * with one depended member. This is initialization of dependency * relation. * <li> ! * there already exists DependencySource object compatible with source * plugin. We will call DependencySource.put on it and append it's ! * dependency list (value in map) with depended (using addPlugin method ! * with overwrite flag set to true) * </ul> * + * @see DependencySource#put + * @see PluginList#addPlugin(IPlugin, boolean) * @param source Source of the dependency. * @param depended Depended plugin on source. */ public void addDependency(IPlugin source, IPlugin depended)//{{{ *************** *** 310,314 **** PluginList deplist=map.get(element); element.put(source); ! deplist.addPlugin(depended); return; } --- 411,415 ---- PluginList deplist=map.get(element); element.put(source); ! deplist.addPlugin(depended,true); return; } *************** *** 342,346 **** { DependencySource source=keys.nextElement(); ! if(PluginList.isCompatible(source.getPluginType(),plugin)) { // It is compatible, so calls put method on --- 443,447 ---- { DependencySource source=keys.nextElement(); ! if(PluginList.areCompatibles(source.getPluginType(),plugin)) { // It is compatible, so calls put method on *************** *** 403,407 **** public void releaseDependency(IPlugin depended)//{{{ { ! List<DependencySource> sourcelist=getSources(depended); if(sourcelist==null) return; --- 504,508 ---- public void releaseDependency(IPlugin depended)//{{{ { ! List<DependencySource> sourcelist=getDependencySources(depended); if(sourcelist==null) return; *************** *** 436,470 **** } }//}}} ! /** Change all original for replace in map. ! * ! * Change all occurence of original (comparing according reference) ! * for replace plugin implementator. Plugins must have the compatible ! * type and the same name. ! * <p> ! * This method is used when we need to replace implementator without ! * removing original from map (an all actions that will follow). * ! * @param original Original plugin in map. ! * @param replace Replace for original. */ ! public void changeImplementator(IPlugin original,IPlugin replace)//{{{ { ! LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.INFO,"DependencyMap.changeImplementator changing all "+original+" with replace "+replace); ! // goes thorought all keys and all values and replace ! // original with replace Enumeration<DependencySource> keys=map.keys(); while(keys.hasMoreElements()) { DependencySource source=keys.nextElement(); ! source.changeImplementator(original,replace); ! PluginList deps=map.get(source); ! if(deps.changePlugin(original,replace)) ! LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"DependencyMap.changeImplementator replaced in dependency list. source="+source.getPluginType()); } ! ! }//}}} ! /** Search for dependency sources for plugin. * * Search for all sources of dependency for given plugin. This is helper --- 537,622 ---- } }//}}} + ! /** Consolidates dependency map. * ! * Changes map according request to change oldone plugin for newone. ! * This occures in conflic situation when newone is going to replace ! * oldone plugin. ! * <p> ! * <b>Process of change</b>: ! * <ul> ! * <li>Both plugins have to have same type (have to be interface ! * compatible - uses PluginList.isCompatible static method). If they ! * aren't returns an error. ! * <li>If oldone is depednency source, just change implementators. ! * <li>Removes oldone from dependencies lists (according referency uses ! * removeExactPlugin method) ! * </ul> ! * @param oldone Original plugin inserted in map. ! * @param newone Replace for oldone plugin. ! * @return 0 if everything ok, negative number otherwise. Error usually ! * means critical situation, because it means that caller doesn't ! * performed all needed checking. */ ! public int consolidateDependencies(IPlugin oldone, IPlugin newone) { ! // type compatibility check ! if(!PluginList.areTypeSame(oldone,newone)) ! return -1; ! ! // change dependency sources Enumeration<DependencySource> keys=map.keys(); while(keys.hasMoreElements()) { DependencySource source=keys.nextElement(); ! if(source.isSource(oldone)) ! { ! // oldone is inserted in dependency source ! // we will change oldone for newone and exit ! // loop (we assume the each plugin can be in one ! // dependency source) ! source.changeImplementator(oldone,newone); ! LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"DependencyMap.consolidateDependencies changed dependency source "+source); ! break; ! } } ! ! // All dependencies of newone are set properly (common with ! // oldone are also set to newone (addDependency works in ! // overwrite mode) ! ! // Set view of the map to easy traverse dependency lists ! Set<Map.Entry<DependencySource,PluginList>> deps=map.entrySet(); ! ! // list of all dependency sources that became orphan (without ! // empty dependency list. These are removed from map after ! // traversing map. (We can't remove them directly because of ! // iteration) ! List<DependencySource> empty=new LinkedList<DependencySource>(); ! ! // traverse dependency map and removes all occurance of oldone ! for(Map.Entry<DependencySource,PluginList> d : deps) ! { ! if(d.getValue().removeExactPlugin(oldone)) ! { ! LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"DependencyMap.consolidateDependencies Removed redundant dependency - "+oldone+" from "+d.getKey()); ! if(d.getValue().size()==0) ! empty.add(d.getKey()); ! ! } ! } ! ! // removes all dependency sources with empty dep list ! for(DependencySource s : empty) ! { ! map.remove(s); ! LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"DependencyMap.consolidateDependencies Removed dependency source "+s+" with no depended plugins"); ! } ! ! return 0; ! } ! /** Search for dependency sources for given plugin. * * Search for all sources of dependency for given plugin. This is helper *************** *** 475,479 **** * found. */ ! protected List<DependencySource> getSources(IPlugin depended)//{{{ { List<DependencySource> sources=new LinkedList<DependencySource>(); --- 627,631 ---- * found. */ ! protected List<DependencySource> getDependencySources(IPlugin depended)//{{{ { List<DependencySource> sources=new LinkedList<DependencySource>(); *************** *** 498,501 **** --- 650,655 ---- }//}}} + // Informational methods. + /** Returns list of depended plugins. * *************** *** 522,532 **** { DependencySource dsource=keys.nextElement(); - PluginList deplist=map.get(source); if(dsource.isSource(source)) ! { ! return new LinkedList<IPlugin>(deplist.toList()); ! } } return null; }//}}} } --- 676,732 ---- { DependencySource dsource=keys.nextElement(); if(dsource.isSource(source)) ! return map.get(dsource).toList(); } return null; }//}}} + + /** Returns all sources of dependencies. + * + * Creates list of all dependencies sources. Each elements of returned + * list is list which contains all implementators. + * Changes made to lists don't take any effect on this dependency map. + * It's just for informational character. + * + * @return List containing lists as elements. Each inner list represents + * one dependency source and its elements (plugins) are all + * implementators. + */ + public List<List<IPlugin>> getSources() + { + Enumeration<DependencySource> keys=map.keys(); + List<List<IPlugin>> result=new LinkedList<List<IPlugin>>(); + List<IPlugin> impls; + + /* Goes throught all keys in map and for each DependencySource + gets all implementator and insert them to the impls. + Each impls inserts to the result list (resulting list + will have same memebers as keys.size(). Each element of + resulting list is list with key's implementators count). + */ + while(keys.hasMoreElements()) + { + DependencySource source=keys.nextElement(); + impls=source.getImplementators(); + + result.add(impls); + } + + return result; + } + + @Override public String toString()//{{{ + { + return map.toString(); + }//}}} + + /** Deep copy creator. + * Use this method to create new deep copy instance of this object. + * + * @return New instance of DependencyMap class. + */ + @Override public Object clone() + { + return new DependencyMap((Hashtable)map.clone()); + } } |
From: Pavel O. <pa...@us...> - 2005-09-15 22:03:00
|
Update of /cvsroot/exfex/exfex/XML/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27065/test Added Files: build.xml test-gen.xml test.xsd Log Message: JAXB example initila version --- NEW FILE: build.xml --- <?xml version="1.0" standalone="yes"?> <!-- Copyright 2004 Sun Microsystems, Inc. All rights reserved. --> <project basedir="." default="run"> <description> This sample application demonstrates how to unmarshal an instance document into a Java content tree and access data contained within it. </description> <!-- if you are not running from $JWSDP_HOME/jaxb/samples AND you are using your own version of Ant, then you need to specify "ant -Djwsdp.home=..." --> <!--property name="jwsdp.home" value="../../.." /--> <property environment="env" /> <property name="jwsdp.home" value="${env.JWSDP_HOME}" /> <path id="classpath"> <pathelement path="src" /> <pathelement path="classes" /> <!--for use with bundled ant--> <fileset dir="${jwsdp.home}" includes="jaxb/lib/*.jar" /> <fileset dir="${jwsdp.home}" includes="jwsdp-shared/lib/*.jar" /> <fileset dir="${jwsdp.home}" includes="jaxp/lib/**/*.jar" /> </path> <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"> <classpath refid="classpath" /> </taskdef> <!--compile Java source files--> <target name="compile" description="Compile all Java source files"> <echo message="Compiling the schema..." /> <mkdir dir="gen-src" /> <xjc schema="test.xsd" package="exfex.xml" target="gen-src"> <produces dir="gen-src/exfex.xml" includes="**/*.java" /> </xjc> <echo message="Compiling the java source files..." /> <mkdir dir="classes" /> <javac destdir="classes" debug="on"> <src path="src" /> <src path="gen-src" /> <classpath refid="classpath" /> </javac> <copy todir="classes"> <fileset dir="gen-src"> <include name="**/*.properties" /> <include name="**/bgm.ser" /> </fileset> </copy> </target> <target name="run" depends="compile" description="Run the sample app"> <echo message="Running the sample application..." /> <java classname="Main" fork="true"> <classpath refid="classpath" /> </java> </target> <target name="javadoc" description="Generates javadoc" depends="compile"> <echo message="Generating javadoc..." /> <mkdir dir="docs/api" /> <javadoc sourcepath="gen-src" destdir="docs/api" windowtitle="Using unmarshaller (formerly SampleApp1)" useexternalfile="yes"> <fileset dir="." includes="gen-src/**/*.java" excludes="**/impl/**/*.java" /> </javadoc> </target> <target name="clean" description="Deletes all the generated artifacts."> <delete dir="docs/api" /> <delete dir="gen-src" /> <delete dir="classes" /> </target> </project> --- NEW FILE: test-gen.xml --- <?xml version="1.0" encoding="UTF-8"?> <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Paja Pupek (student) --> <!--Sample XML file generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)--> <Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="E:\xml\test.xsd" IdName="test_id_name"> <Creator>Name</Creator> <Security> <Model>ModelName</Model> <CheckSum> <Type>TypeName</Type> </CheckSum> </Security> <Access> <Member> <Type>TypeName</Type> <Name>name</Name> </Member> </Access> <Restriction> <Time> <Hours>0</Hours> <Minutes>10</Minutes> <Seconds>0</Seconds> </Time> </Restriction> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> <Question IdName="question_id_name"> <Assigment>html text</Assigment> <Hint>Html text</Hint> <Solution IdName="solution_id_name"> <Price>5</Price> <SolutionStrategy>Name</SolutionStrategy> <Answer> <Type>TypeName</Type> <Data>html text</Data> <CorrectForm>correct data</CorrectForm> <Rank>1</Rank> </Answer> </Solution> </Question> </Test> --- NEW FILE: test.xsd --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Paja Pupek (student) --> <!--W3C Schema generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)--> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="Access"> <xs:complexType> <xs:sequence> <xs:element ref="Member"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Answer"> <xs:complexType> <xs:sequence> <xs:element ref="Type"/> <xs:element ref="Data"/> <xs:element ref="CorrectForm"/> <xs:element ref="Rank"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Assigment"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="html text"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="CheckSum"> <xs:complexType> <xs:sequence> <xs:element ref="Type"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="CorrectForm"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="correct data"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Creator"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Name"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Data"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="html text"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Hint"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Html text"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Hours"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="0"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Member"> <xs:complexType> <xs:sequence> <xs:element ref="Type"/> <xs:element ref="Name"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Minutes"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="10"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Model"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="ModelName"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Name"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="name"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Price"> <xs:simpleType> <xs:restriction base="xs:byte"> <xs:enumeration value="5"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Question"> <xs:complexType> <xs:sequence> <xs:element ref="Assigment"/> <xs:element ref="Hint"/> <xs:element ref="Solution"/> </xs:sequence> <xs:attribute name="IdName" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="question_id_name"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="Rank"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Restriction"> <xs:complexType> <xs:sequence> <xs:element ref="Time"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Seconds"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="0"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Security"> <xs:complexType> <xs:sequence> <xs:element ref="Model"/> <xs:element ref="CheckSum"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Solution"> <xs:complexType> <xs:sequence> <xs:element ref="Price"/> <xs:element ref="SolutionStrategy"/> <xs:element ref="Answer"/> </xs:sequence> <xs:attribute name="IdName" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="solution_id_name"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="SolutionStrategy"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Name"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Test"> <xs:complexType> <xs:sequence> <xs:element ref="Creator"/> <xs:element ref="Security"/> <xs:element ref="Access"/> <xs:element ref="Restriction"/> <xs:sequence maxOccurs="unbounded"> <xs:element ref="Question"/> </xs:sequence> </xs:sequence> <xs:attribute name="IdName" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="test_id_name"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="Time"> <xs:complexType> <xs:sequence> <xs:element ref="Hours"/> <xs:element ref="Minutes"/> <xs:element ref="Seconds"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Type"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="TypeName"/> <xs:enumeration value="TypeOfCheckSum"/> <xs:enumeration value="name"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:schema> |
From: Pavel O. <pa...@us...> - 2005-09-15 22:03:00
|
Update of /cvsroot/exfex/exfex/XML/test/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27065/test/src Added Files: Main.java Log Message: JAXB example initila version --- NEW FILE: Main.java --- /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.io.FileInputStream; import java.io.IOException; import java.util.Iterator; import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; // import java content classes generated by binding compiler import exfex.xml.*; /* * $Id: Main.java,v 1.1 2005/09/15 22:02:51 pavel_o Exp $ * * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. * * This software is the proprietary information of Sun Microsystems, Inc. * Use is subject to license terms. * */ public class Main { // This sample application demonstrates how to unmarshal an instance // document into a Java content tree and access data contained within it. public static void main( String[] args ) { try { // create a JAXBContext capable of handling classes generated into // the primer.po package JAXBContext jc = JAXBContext.newInstance( "exfex.xml" ); // create an Unmarshaller Unmarshaller u = jc.createUnmarshaller(); // unmarshal a po instance document into a tree of Java content // objects composed of classes from the primer.po package. Test test = (Test)u.unmarshal( new FileInputStream( "test-gen.xml" ) ); // examine some of the content in the PurchaseOrder System.out.println( "Ship the following items to: " ); // display the test id String id = test.getIdName(); System.out.println("Test id: " + id ); // display the items //Items items = po.getItems(); //displayItems( items ); } catch( JAXBException je ) { je.printStackTrace(); } catch( IOException ioe ) { ioe.printStackTrace(); } } /* public static void displayAddress( USAddress address ) { // display the address System.out.println( "\t" + address.getName() ); System.out.println( "\t" + address.getStreet() ); System.out.println( "\t" + address.getCity() + ", " + address.getState() + " " + address.getZip() ); System.out.println( "\t" + address.getCountry() + "\n"); } public static void displayItems( Items items ) { // the items object contains a List of primer.po.ItemType objects List itemTypeList = items.getItem(); // iterate over List for( Iterator iter = itemTypeList.iterator(); iter.hasNext(); ) { Items.ItemType item = (Items.ItemType)iter.next(); System.out.println( "\t" + item.getQuantity() + " copies of \"" + item.getProductName() + "\"" ); } }*/ } |
From: Pavel O. <pa...@us...> - 2005-09-15 22:02:08
|
Update of /cvsroot/exfex/exfex/XML/test/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26764/src Log Message: Directory /cvsroot/exfex/exfex/XML/test/src added to the repository |
From: Pavel O. <pa...@us...> - 2005-09-15 22:01:37
|
Update of /cvsroot/exfex/exfex/XML/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26636/test Log Message: Directory /cvsroot/exfex/exfex/XML/test added to the repository |
From: Michal H. <ms...@us...> - 2005-09-15 18:14:04
|
Update of /cvsroot/exfex/exfex/doc/konvencie In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6671/doc/konvencie Modified Files: file.java Added Files: package.html Log Message: conventions changes --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <-- Template for package description file for Java Doc TODO: Add to the CVS --> </head> <body bgcolor="white"> <h2>Package Specification</h2> <h2>Related Documentation</h2> </body> </html> Index: file.java =================================================================== RCS file: /cvsroot/exfex/exfex/doc/konvencie/file.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** file.java 14 Aug 2005 15:07:59 -0000 1.2 --- file.java 15 Sep 2005 18:13:56 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:13:56 mstsxfx + * conventions changes + * * Revision 1.2 2005/08/14 15:07:59 mstsxfx * CVS info in files *************** *** 20,28 **** * * This can be also as a part of comments in method body ! * TODO what should be done ! * FIXME what should be fixed * * Changes (just corrections): * date Short description of changes */ --- 23,36 ---- * * This can be also as a part of comments in method body ! * * + * <pre> + * TODO what should be done + * FIXME what should be fixed + * + * * Changes (just corrections): * date Short description of changes + * </pre> */ *************** *** 39,52 **** /** Short description. * * @param param1 Short description. * @param param2 ----||----- - * ... - * - * Detailed description... - * * @return Return values description. - * @return Other return values. - * * @throws Excetion descrition. * --- 47,58 ---- /** Short description. + * + * Detailed description... * + * Taged part + * @see related stuff * @param param1 Short description. * @param param2 ----||----- * @return Return values description. * @throws Excetion descrition. * |
From: Michal H. <ms...@us...> - 2005-09-15 18:11:15
|
Update of /cvsroot/exfex/exfex/source/exfex/common/logging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5834/source/exfex/common/logging Modified Files: LogManagerException.java Logger.java LoggerStream.java ILoggerStream.java NullLogger.java ILogger.java LogManager.java Destination.java Log Message: documentation corrected som code fixing Index: NullLogger.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/NullLogger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NullLogger.java 6 Sep 2005 17:50:45 -0000 1.4 --- NullLogger.java 15 Sep 2005 18:11:02 -0000 1.5 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.5 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.4 2005/09/06 17:50:45 mstsxfx * new 2 layers model *************** *** 13,19 **** package exfex.common.logging; - import java.io.OutputStream; ! /** Loger with no loging facilities. * * This loger is defined because of situation where we want to return --- 17,22 ---- package exfex.common.logging; ! /** Logger with no loging facilities. * * This loger is defined because of situation where we want to return *************** *** 21,35 **** * User can use LogManager in following way and it's safe:<br> * LogManager.getInstance().getLoger(name).log(...) ! * <br> * NullLoger is singleton so, use getInstance method to acces it. ! * <br> * If name is not registered, application will not crash on * nullPointerException, because getLoger return NullLoger and we can call * log method on it (log will have no efect). * ! * @author msts ! * * Changes: * 26.7.2005 msts - created */ public class NullLogger implements ILogger --- 24,41 ---- * User can use LogManager in following way and it's safe:<br> * LogManager.getInstance().getLoger(name).log(...) ! * <p> * NullLoger is singleton so, use getInstance method to acces it. ! * <p> * If name is not registered, application will not crash on * nullPointerException, because getLoger return NullLoger and we can call * log method on it (log will have no efect). * ! * ! * <pre> * Changes: * 26.7.2005 msts - created + * </pre> + * + * @author msts */ public class NullLogger implements ILogger *************** *** 38,46 **** private static NullLogger instance=new NullLogger(); protected NullLogger() { } ! /** Returns instance of NullLoger. */ static public ILogger getInstance() { --- 44,60 ---- private static NullLogger instance=new NullLogger(); + /** Default construcotr. */ protected NullLogger() { } ! /** Returns instance of NullLoger. ! * ! * This object is intended to be shared so there is only one instance ! * of this logger (it is singleton). Only way to get instance of logger ! * is to call this static method. ! * ! * @return Logger instance. ! */ static public ILogger getInstance() { Index: LogManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/LogManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LogManager.java 6 Sep 2005 17:50:45 -0000 1.6 --- LogManager.java 15 Sep 2005 18:11:02 -0000 1.7 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.7 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.6 2005/09/06 17:50:45 mstsxfx * new 2 layers model *************** *** 26,31 **** /** Logger manager. * ! * Stores and manages all loggers. ! * <br> * <b>Initialization</b>: Instance of this class is created as static field, * so you don't have to (and actualy can't) create it by yourself. --- 30,35 ---- /** Logger manager. * ! * This class has responsibilities to stores and manage all loggers. ! * <p> * <b>Initialization</b>: Instance of this class is created as static field, * so you don't have to (and actualy can't) create it by yourself. *************** *** 34,68 **** * SettingManager is created, loadFromSettings should be called to initialize * setting spedific stuff. ! * <br> * <b>Using</b>: When you want to use LogManager, you should be sure that ! * loadFromSettings has already been called. This class behave like singleton, ! * so you can't create instance with new operator (as mentioned). To get ! * instance, use getInstance method. If you want to get logger with specific ! * name, you should call getLogger method. When want to manage loggers use ! * registerFileDestination and unRegisterFileDestination methods for file ! * targets. Network logging is planed for future (registerNetworkDestination). ! * <br> * Synchronization of the class is made by reentrant read write lock, so * many readers are allowed but only one writer for managing loggers (those * are synchronized too - with synchronized methods). ! * <br> * <b>Loggers identification</b>: All loggers can be identified by their names. * There are no restrictions on names form with exception, that empty (not null) ! * stands for standard error output. Logger name is bind to target, which can ! * be file (at the moment - preparing for general URL). They are bound together ! * in Destination class. ! * ! * @see Destination ! * <br> * <b>Loggers sharing</b>: All loggers with same file target are shared. This * means that LogManager gaurantee, that this loggers will have same low level ! * logger device. Logger can set their logic (prefix, log level, etc.) upon ! * logger device but loger device guarantee that printed messages won't be ! * messed in multithread environment and phisical file will be opend just onced. ! * ! * @author msts * ! * TODO: Unit tests, managing time display in logs according to settings, ! * enable settings code (when SettingManager is done) * * Changes --- 38,72 ---- * SettingManager is created, loadFromSettings should be called to initialize * setting spedific stuff. ! * <p> * <b>Using</b>: When you want to use LogManager, you should be sure that ! * loadFromSettings has already been called. Otherwise you possibly won't be ! * able to get appropriate logger defined in configuration. ! * This class behave like singleton, so you can't create instance with new ! * operator (as mentioned). To get instance, use getInstance method. If you want ! * to get logger with specific name, you should call getLogger method. When want ! * to manage loggers use registerFileDestination and unRegisterFileDestination ! * methods for file targets. NOTE: Network logging is planed for future ! * (registerNetworkDestination). ! * <p> * Synchronization of the class is made by reentrant read write lock, so * many readers are allowed but only one writer for managing loggers (those * are synchronized too - with synchronized methods). ! * <p> * <b>Loggers identification</b>: All loggers can be identified by their names. * There are no restrictions on names form with exception, that empty (not null) ! * stands for standard error output. Be carefull to use correct case letters ! * (logger names are case sensitive "Logger" is not the same as "loger"). ! * Logger name is bind to target, which can be file (at the moment - preparing ! * for general URL). They are bound together in Destination class. ! * <p> * <b>Loggers sharing</b>: All loggers with same file target are shared. This * means that LogManager gaurantee, that this loggers will have same low level ! * logger device. Loggers can set their unique logic (prefix, log level, etc.) ! * upon logger device but loger device guarantee that printed messages won't be ! * messed in multithread environment and physical file will be opend just onced. ! * TODO: model picture * ! * <pre> ! * TODO: use SettingManager * * Changes *************** *** 73,76 **** --- 77,84 ---- * ready to use * 24.7.2005 msts - created + * </pre> + * + * @see Destination + * @author msts */ public class LogManager *************** *** 96,99 **** --- 104,108 ---- /** Table of (name, Logger) pairs. */ private Hashtable<String,ILogger> loggerMap=new Hashtable<String,ILogger>(); + /** Table of (filename, ILoggerStream) pairs. * This is table is used to find out same destinations (and so *************** *** 105,112 **** * * Basic constructor which registeres just STANDARD_LOG with standard ! * output stream. This logger is used to log information in time when ! * no configuration is available. * ! * @see registerFileDestination */ private LogManager() --- 114,125 ---- * * Basic constructor which registeres just STANDARD_LOG with standard ! * error stream. This logger is used to log information in time when ! * no configuration is available. ! * <p> ! * User of logger shoul call loadFromSettings after setting manager is ! * initialized and contains all logger specific configuration. * ! * @see LogManager#loadFromSettings ! * @see LogManager#registerFileDestination */ private LogManager() *************** *** 122,131 **** * that are defined in Logging.Files setting (value of this node is * set off pairs (LogerName,Target). ! * <br> ! * <b>NOTE:</b> Relies on correct values from SettingManager. ! * <br> * Uses STANDARD_LOG logger to log information. * ! * @see registerFileDestination * @see exfex.common.settings.SettingManager * @see ILogger --- 135,142 ---- * that are defined in Logging.Files setting (value of this node is * set off pairs (LogerName,Target). ! * <p> * Uses STANDARD_LOG logger to log information. * ! * @see LogManager#registerFileDestination * @see exfex.common.settings.SettingManager * @see ILogger *************** *** 175,180 **** /** Returns instance of manager. - * - * NOTE: Has to be synchronized? * * @return Instance of LogManager. --- 186,189 ---- *************** *** 186,195 **** /** Creates OutputFileStream for targer file. - * @param target File name for OutputStream. * * Creates OutputStream from target filename. If filename is empty * string then standard error output is used. * * @return Output stream. */ protected OutputStream createFileOutput(String target)throws FileNotFoundException//{{{ --- 195,205 ---- /** Creates OutputFileStream for targer file. * * Creates OutputStream from target filename. If filename is empty * string then standard error output is used. * + * @param target File name for OutputStream. * @return Output stream. + * @throws FileNotFoundException if target is not regular file. */ protected OutputStream createFileOutput(String target)throws FileNotFoundException//{{{ *************** *** 209,221 **** /** Register new file destination. - * @param dest Destination to register. - * @param level LogLevel of Logger. * * Registers new destination where dest.getTarget() is file name. * Empty (not null) file name stands for standard error output. ! * <br> * If dest or any of its fields is null, immediately return (doesn't * complain). ! * <br> * When creating logger, at first find out if destination name is * registered already. If so, it will exit method, because it's nothing --- 219,229 ---- /** Register new file destination. * * Registers new destination where dest.getTarget() is file name. * Empty (not null) file name stands for standard error output. ! * <p> * If dest or any of its fields is null, immediately return (doesn't * complain). ! * <p> * When creating logger, at first find out if destination name is * registered already. If so, it will exit method, because it's nothing *************** *** 226,236 **** * device is shared). If no such device found, creates new one from file * stream. ! * <br> * NOTE: To keep information about all registered (file, logger device) * uses descriptorMap. ! * <br> * NOTE: Two file targets are supposed to be same iff getCanonicalPath * method from File class returns same string). ! * <br> * If new logger is created, uses SettingManager to find out default * prefix and verbosity level for all loggers. If there are also values --- 234,244 ---- * device is shared). If no such device found, creates new one from file * stream. ! * <p> * NOTE: To keep information about all registered (file, logger device) * uses descriptorMap. ! * <p> * NOTE: Two file targets are supposed to be same iff getCanonicalPath * method from File class returns same string). ! * <p> * If new logger is created, uses SettingManager to find out default * prefix and verbosity level for all loggers. If there are also values *************** *** 240,243 **** --- 248,252 ---- * target name logger pair to the descriptorMap. * + * @param dest Destination to register. */ public void registerFileDestination(Destination dest)//{{{ *************** *** 354,360 **** /** Removes destination and its logger from loggerMap. - * @param dest Destination to be removed. * * Flushes logger and removes destination from registered. */ public void unRegisterFileDestination(Destination dest)//{{{ --- 363,370 ---- /** Removes destination and its logger from loggerMap. * * Flushes logger and removes destination from registered. + * + * @param dest Destination to be removed. */ public void unRegisterFileDestination(Destination dest)//{{{ *************** *** 371,379 **** /** Returns logger by destination name. - * @param name Name of destination. * * Search for registered destinations. If there is destinations with * given name, returns its Logger. ! * * @return Logger object if name is registered or NullLogger otherwise. * --- 381,389 ---- /** Returns logger by destination name. * * Search for registered destinations. If there is destinations with * given name, returns its Logger. ! * ! * @param name Name of destination. * @return Logger object if name is registered or NullLogger otherwise. * Index: Destination.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/Destination.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Destination.java 15 Aug 2005 17:31:13 -0000 1.2 --- Destination.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/15 17:31:13 mstsxfx * Class is public + documentation *************** *** 12,22 **** * * Class to keep information about destination defined as pair ! * (name, target). All methods are synchronized, so they can be ! * used in multi-thread environment. * - * @author msts * * Changes: * 26.7.2005 msts - created */ public class Destination --- 16,32 ---- * * Class to keep information about destination defined as pair ! * (name, target). name represents symbolic name of destination and target ! * stands for name of physical device (e.g. file name). ! * <p> ! * NOTE: All methods are synchronized, so they can be used in multi-thread ! * environment. * * + * <pre> * Changes: * 26.7.2005 msts - created + * </pre> + * + * @author msts */ public class Destination *************** *** 39,46 **** /** Complet constructor. - * @param name Name of destination. - * @param target Target of destination. * * Sets name and target fields according parameters. */ public Destination(String name,String target)//{{{ --- 49,57 ---- /** Complet constructor. * * Sets name and target fields according parameters. + * + * @param name Name of destination. + * @param target Target of destination. */ public Destination(String name,String target)//{{{ *************** *** 50,54 **** }//}}} ! /** Returns the name of destination. */ synchronized public String getName()//{{{ { --- 61,68 ---- }//}}} ! /** Returns the name of destination. ! * ! * @return String name of Destination. ! */ synchronized public String getName()//{{{ { *************** *** 56,60 **** }//}}} ! /** Returns the target of destination. */ synchronized public String getTarget()//{{{ { --- 70,77 ---- }//}}} ! /** Returns the target of destination. ! * ! * @return String representation of target. ! */ synchronized public String getTarget()//{{{ { *************** *** 63,70 **** /** Sets new name. - * @param name New name. * * Sets new name of destination. * * @return Old value of name. */ --- 80,87 ---- /** Sets new name. * * Sets new name of destination. * + * @param name New name. * @return Old value of name. */ *************** *** 77,84 **** /** Sets new target. - * @param target New target name. * * Sets new target of destination. * * @return Old value of target. */ --- 94,101 ---- /** Sets new target. * * Sets new target of destination. * + * @param target New target name. * @return Old value of target. */ *************** *** 90,94 **** }//}}} ! public boolean equals(Object o)//{{{ { return o.equals(this); --- 107,118 ---- }//}}} ! /** ! * ! * TODO: rewrite ! * ! * @param o Object to compare. ! * @return true if o equals with this instance, otherwise false. ! */ ! @Override public boolean equals(Object o)//{{{ { return o.equals(this); Index: ILogger.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/ILogger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ILogger.java 6 Sep 2005 17:50:45 -0000 1.4 --- ILogger.java 15 Sep 2005 18:11:02 -0000 1.5 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.5 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.4 2005/09/06 17:50:45 mstsxfx * new 2 layers model *************** *** 12,29 **** package exfex.common.logging; - import java.io.*; /** Logger interface. * - * Interface to handle log facilities. * ! * @author msts * * Changes: * 24.7.2005 - msts - created */ public interface ILogger { ! /** Level/Priority of leged message. */ public static enum Level { NONE, PANIC, CRIT, ERROR, --- 16,94 ---- package exfex.common.logging; /** Logger interface. * * ! * Logger is object that manages logging facilities. This interface expects ! * 2 layer model of logging. ! * <ul> ! * <li>High level API which keeps logic of what message looks like and makes ! * decisions wich message to log and which to suppress. This API is available ! * as this ILogger interface. ! * <li>Low level logging device is responsible just to write data. ! * </ul> ! * TODO: picture ! * ! * This model for examle enables to share logger device to prevent mess in ! * logs in multi-threaded environment and keeps logic unique for each logger. ! * Logger itself doesn't know physical device he is writing to. It relies on ! * java DataOutputStream. ! * <p> ! * ILogger interface provides following facilities: ! * <ul> ! * <li>priorities (as Level enum) for messages and implementator can use these ! * priorities for its purposes. ! * <li>logLevel as verbosity filter which can be used to determine which ! * messages to log and which to discard. Use setLogLevel method. ! * <li>prefix as string which will starts each string that is logged by logging ! * low level device. Use setPrefix method. ! * <li>TODO: time format string. Use setTimeDisplay method. * + * <pre> + * TODO: change setTimeDisplay to give string format instead of boolean value + * * Changes: * 24.7.2005 - msts - created + * </pre> + * + * @author msts */ public interface ILogger { ! /** Level/Priority of leged message. ! * ! * Levels for for messages priorities. ! * ! * <br><b>Priorities overview</b>:<br> ! * <ul> ! * <li>NONE - never logs, this used just for lower bound representation. ! * <li>PANIC - this should mark unrecoverable and unaxpectable error ! * message. Program usualy crash after message. ! * <li>CRIT - this should mark critical errors. System is recoverable ! * only with administrator (or user) assistance. ! * <li>ERROR - this should mark recoverable error. System is can handle ! * situation without external assistance. This usualy happen when system ! * is misconfigured or wrong data are supplied. ! * <li>WARN - this should mark unexpected behaviour, but not producing ! * error. ! * <li>NOTICE - this should mark usefull information about some performed ! * action. Administrator (or user) uses this information to see internal ! * processes. ! * <li>INFO - this should mark additional information about internal ! * processes. Administrator (or user) uses this information to see ! * detailed internal stuff. ! * <li>DEBUG - this should mark detailed information about interbal ! * processes. It should be used by developers to debug some system's ! * internal component. ! * </ul> ! * ! * ! * <pre> ! * Changes: ! * 14.9.2005 msts - documentation ! * </pre> ! * ! * @author msts ! */ public static enum Level { NONE, PANIC, CRIT, ERROR, *************** *** 31,61 **** /** Loging method. * @param level Priority of message. ! * @param message Message to log. */ public void log(Level level, String message); /** Output setter. ! * @param output Output stream where to log messages. */ public void setOutput(ILoggerStream output); /** Log level setter. ! * @param level Verbosity level. * ! * Verbosity level - all messages with priority higher (with lower ! * value) are loged. */ public int setLogLevel(int level); ! /** Prefix setter. ! * @param pref Prefix for output messages. ! */ public String setPrefix(String pref); ! /** Flushes OutputStream. */ public void flush(); ! /** Sets option that controls displaying time in logs. */ public void setTimeDisplay(boolean display); } --- 96,172 ---- /** Loging method. + * + * This method perform logger logic (check if message should be logged, + * format message to correct form, etc.) and send ready message to + * the low level logger device. + * <p> + * <b>General logging proces</b>:<br> + * Tests if priority of message is lower (number) then logLevel and if + * so print message using out stream. + * Loged output consist of header and body. Body is message given as + * parameter. Header is implementation specific. + * <p> + * Each priority (level) should represent message importance. + * + * @see ILogger.Level * @param level Priority of message. ! * @param message Message to log. */ public void log(Level level, String message); /** Output setter. ! * ! * Sets low level logger device. Old one is flushed and forgotten. ! * ! * @param output Output stream where to log messages. */ public void setOutput(ILoggerStream output); + /** Log level setter. ! * ! * Sets new logLevel value. If new value is out of boundary, ! * no change is performed. ! * <p> ! * This value is used as verbosity filter. Each log message ! * priority is compared with thisvalue and only lower are displayed. ! * If we want to set no output at all, just set logLevel to NONE. On ! * contrary, if you you want to display all messages, set logLevel ! * to DEBUG value. ! * <p> ! * Using this logLevel filter, we can get apart loging logic from ! * verbosity. * ! * @param level Verbosity level. ! * @return Old value of logLevel or -1 If no action is performed. */ public int setLogLevel(int level); ! /** Sets new prefix. ! * ! * Sets new prefix string. There are no constrains on new value. ! * ! * @param pref New prefix string. ! * @return Old value of prefix. ! */ public String setPrefix(String pref); ! /** Flushes OutputStream. ! * ! * This means that all cached data should be writen. This method should ! * just delegate flush to the low level logger device. ! */ public void flush(); ! /** Sets value of displayTime field. ! * ! * Sets field that controls displaying time in log messages. ! * If the value is true, then whole input is preceeded by ! * actual local time. ! * <p> ! * TODO: change to String which represents time format. ! * ! * @param display New value of field. ! */ public void setTimeDisplay(boolean display); } Index: LogManagerException.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/LogManagerException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LogManagerException.java 6 Sep 2005 17:50:14 -0000 1.1 --- LogManagerException.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 4,7 **** --- 4,19 ---- public class LogManagerException extends Exception { + /** + * Field for serialization purposes. + */ + static final long serialVersionUID=1L; + + /** Constructor with message parameter. + * + * Just forward message to superclass constructor. + * + * @param msg Detailed information about exception's condition. + * + */ public LogManagerException(String msg) { Index: ILoggerStream.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/ILoggerStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ILoggerStream.java 6 Sep 2005 17:43:14 -0000 1.1 --- ILoggerStream.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 7,19 **** * This interface stands for Low level Logger device. * Implementator of this interface is used by ILogger implementator to write ! * concrete data to logger target. As output uses DataOutputStream. * All methods should be synchronized to prevent confusing of output from * multithread environment. If more ILogger's implementators have same file * target, implementator of ILoggerStream is shared. * ! * @author msts ! * * Changes: * 5.9.2005 msts - created */ public interface ILoggerStream --- 7,23 ---- * This interface stands for Low level Logger device. * Implementator of this interface is used by ILogger implementator to write ! * concrete data to logger target. As output uses DataOutputStream, but doesn't ! * know what kind of device it is. ! * <p> * All methods should be synchronized to prevent confusing of output from * multithread environment. If more ILogger's implementators have same file * target, implementator of ILoggerStream is shared. * ! * <pre> * Changes: * 5.9.2005 msts - created + * </pre> + * + * @author msts */ public interface ILoggerStream *************** *** 25,31 **** /** Close output stream and sets new one. - * @param stream New stream to set. * * Fulsh old stream and sets given as new output. */ public void setOutput(DataOutputStream stream); --- 29,36 ---- /** Close output stream and sets new one. * * Fulsh old stream and sets given as new output. + * + * @param stream New stream to set. */ public void setOutput(DataOutputStream stream); Index: Logger.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/Logger.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Logger.java 6 Sep 2005 17:50:45 -0000 1.6 --- Logger.java 15 Sep 2005 18:11:02 -0000 1.7 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.7 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.6 2005/09/06 17:50:45 mstsxfx * new 2 layers model *************** *** 18,26 **** package exfex.common.logging; - import java.io.DataOutputStream; - import java.io.IOException; - import java.io.OutputStream; - import java.util.Date; - /** Class for logging information. * --- 22,25 ---- *************** *** 30,34 **** * writing to the Data output stream. Low level logger device is represented by * ILoggerStream implementator (given in constructor or setOutput method. ! * <br> * Logger has internal verbosity filter which controls which message should * be printed and which supressed. Verbosity filter is represented by logLevel. --- 29,34 ---- * writing to the Data output stream. Low level logger device is represented by * ILoggerStream implementator (given in constructor or setOutput method. ! * TODO: insert scheme picture ! * <p> * Logger has internal verbosity filter which controls which message should * be printed and which supressed. Verbosity filter is represented by logLevel. *************** *** 37,55 **** * or setLogLevel method). If priority is equal or lower than logLevel message * is printed using logger device. ! * <br> * Message priority is represented by ILogger.Level enum. ! * @see ILogger.Level ! * <br> * To provide customizable output, you can define prefix which will be in the * begining of each message. This is set also in constructor. ! * @see log ! * <br> ! * <b>NOTE</b>. ! * All method are synchrinized so they can be used in multi-threaded * environment. * - * @author msts - * * * Changes: * 5.9.2005 msts - reimplemented - devided to 2 layers (high level and --- 37,51 ---- * or setLogLevel method). If priority is equal or lower than logLevel message * is printed using logger device. ! * <p> * Message priority is represented by ILogger.Level enum. ! * <p> * To provide customizable output, you can define prefix which will be in the * begining of each message. This is set also in constructor. ! * <p> ! * NOTE: All method are synchrinized so they can be used in multi-threaded * environment. * * + * <pre> * Changes: * 5.9.2005 msts - reimplemented - devided to 2 layers (high level and *************** *** 58,63 **** * unique setting and logger devices can be shared) * 10.8.2005 msts - created * ! * */ public class Logger implements ILogger --- 54,61 ---- * unique setting and logger devices can be shared) * 10.8.2005 msts - created + * </pre> * ! * @see ILogger.Level ! * @author msts */ public class Logger implements ILogger *************** *** 88,91 **** --- 86,95 ---- private String prefix; + /** Time flag. + * + * This field controls setting of time displaying in message. + * + * TODO: rewrite to time format instead of boolean. + */ private boolean displayTime=false; *************** *** 103,111 **** /** Constructor. * * @param level Level of verbosity number. * @param output Output stream. ! * ! * Sets values of logLevel and out fields. If output is null ! * reference, out will be set to System.err stream. */ public Logger(int level, ILoggerStream output, String pref)//{{{ --- 107,117 ---- /** Constructor. * + * Sets values of logLevel, out and prefix fields. If output is null + * reference, out will be set to System.err stream. + * * @param level Level of verbosity number. * @param output Output stream. ! * @param pref Prefix string. ! * */ public Logger(int level, ILoggerStream output, String pref)//{{{ *************** *** 120,130 **** /** Function for loging. * ! * @param priority Priority of message. ! * @param message Message string. ! * ! * Tests if priority of message is lower (number) then logLevel and if ! * so print message using out stream. ! * Loged output consist of header and body. Body is message given as ! * parameter. * <br> * Header has one obligatory part which is string format of priority --- 126,130 ---- /** Function for loging. * ! * Specific behaviour: * <br> * Header has one obligatory part which is string format of priority *************** *** 134,137 **** --- 134,141 ---- * So output will look like:<br> * <i>[time][prefix: ]PRIORITY message</i> + * + * @param priority Priority of message. + * @param message Message string. + * */ synchronized public void log(Level priority,String message)//{{{ *************** *** 153,159 **** /** Sets new output stream. * ! * @param output Output stream. ! * ! * Sets new value of output stream. */ synchronized public void setOutput(ILoggerStream output)//{{{ --- 157,161 ---- /** Sets new output stream. * ! * @inheritDoc */ synchronized public void setOutput(ILoggerStream output)//{{{ *************** *** 165,182 **** /** Sets new value of logLevel. * ! * @param logLevel New loglevel value. ! * ! * Sets new logLevel value. If new value is out of boundary, ! * no change is performed.<br> ! * This value is used as verbosity filter. Each log message ! * priority is compared with thisvalue and only lower are displayed. ! * If we want to set no output at all, just set logLevel to NONE. On ! * contrary, if you you want to display all messages, set logLevel ! * to DEBUG value.<br> ! * Using this logLevel filter, we can get apart loging logic from ! * verbosity. * ! * @return Old value of logLevel. ! * @return -1 If no action is performed. */ synchronized public int setLogLevel(int level)//{{{ --- 167,173 ---- /** Sets new value of logLevel. * ! * @param level New loglevel value. * ! * @inheritDoc */ synchronized public int setLogLevel(int level)//{{{ *************** *** 194,202 **** /** Sets new prefix. * ! * @param pref New prefix string. ! * ! * Sets new prefix string. There are no constrains on new value. ! * ! * @return Old value of prefix. */ synchronized public String setPrefix(String pref)//{{{ --- 185,189 ---- /** Sets new prefix. * ! * @inheritDoc */ synchronized public String setPrefix(String pref)//{{{ *************** *** 208,212 **** }//}}} ! /** Flushes output. */ synchronized public void flush()//{{{ { --- 195,201 ---- }//}}} ! /** Flushes output. ! * @inheritDoc ! */ synchronized public void flush()//{{{ { *************** *** 216,224 **** /** Sets value of displayTime field. ! * @param display New value of field. ! * ! * Sets field that controls displaying time in log messages. ! * If the value is true, then whole input is preceeded by ! * actual local time. */ synchronized public void setTimeDisplay(boolean display)//{{{ --- 205,209 ---- /** Sets value of displayTime field. ! * @inheritDoc */ synchronized public void setTimeDisplay(boolean display)//{{{ Index: LoggerStream.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/LoggerStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LoggerStream.java 6 Sep 2005 17:43:14 -0000 1.1 --- LoggerStream.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 6,14 **** import java.io.IOException; ! /** Low level logger. * * Implementator of the ILoggerStream interafce (low level logger device). * This class is used to write data given from high level ILogger implementator. ! * <br> * All data are writen to the DataOutputStream created in constructor (or set * by setOutput method. --- 6,14 ---- import java.io.IOException; ! /** Low level logger device. * * Implementator of the ILoggerStream interafce (low level logger device). * This class is used to write data given from high level ILogger implementator. ! * <p> * All data are writen to the DataOutputStream created in constructor (or set * by setOutput method. *************** *** 17,24 **** * loggers. * ! * @author msts ! * * Changes: * 5.9.2005 msts - created */ class LoggerStream implements ILoggerStream --- 17,26 ---- * loggers. * ! * <pre> * Changes: * 5.9.2005 msts - created + * </pre> + * + * @author msts */ class LoggerStream implements ILoggerStream *************** *** 30,33 **** --- 32,41 ---- } + /** Constructor from DataOutputStream instance. + * + * Sets output field to given one. + * + * @param stream Stream where to write. + */ public LoggerStream(DataOutputStream stream) { *************** *** 36,43 **** /** Prints message to the output stream. - * @param message Message to write. * * Writes message to the output stream. If no output stream is * specified (output is null), just ignore and does nothing. */ synchronized public void println(String message)//{{{ --- 44,52 ---- /** Prints message to the output stream. * * Writes message to the output stream. If no output stream is * specified (output is null), just ignore and does nothing. + * + * @param message Message to write. */ synchronized public void println(String message)//{{{ *************** *** 55,61 **** /** Sets new output stream. - * @param stream New output stream. * * Flushes old output stream and sets new one from given parameter. */ synchronized public void setOutput(DataOutputStream stream)//{{{ --- 64,71 ---- /** Sets new output stream. * * Flushes old output stream and sets new one from given parameter. + * + * @param stream New output stream. */ synchronized public void setOutput(DataOutputStream stream)//{{{ |
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5834/source/exfex/common/displaysystem Modified Files: IWindow.java SessionState.java ILayout.java ISessionFactory.java IEvent.java IButton.java IButtonFactory.java IEventDispatcher.java IPrimitivesFactory.java ITextAble.java ILayoutFactory.java ISession.java SessionNode.java ISessionManager.java IComponent.java IEventOnClick.java ILabel.java ILabelFactory.java IDisplayManager.java Added Files: ICaster.java Log Message: documentation corrected som code fixing Index: IWindow.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IWindow.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IWindow.java 4 Sep 2005 19:05:51 -0000 1.3 --- IWindow.java 15 Sep 2005 18:11:02 -0000 1.4 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.4 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.3 2005/09/04 19:05:51 mstsxfx * New methods *************** *** 17,28 **** package exfex.common.displaysystem; - import javax.swing.*; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; /** Basic interface for window. * * This interface represents basic graphic primitive (a window). ! * All primitives extend this interface. */ public interface IWindow --- 21,29 ---- package exfex.common.displaysystem; /** Basic interface for window. * * This interface represents basic graphic primitive (a window). ! * All display able primitives extend this interface. */ public interface IWindow *************** *** 47,62 **** /** Return window implementation. ! * * Window is abstract object, that delegates all its operations to the ! * low level window object. This object is of IComponent type, which is ! * proxy interface. It means that IComponent is interface with no ! * methods defined. It only extends some basic (in hierarchy) graphic ! * element (such JComponent). This part of code is independed on system ! * of displaying (HTML output or SWING gui). But be aware, client ! * (caller of the getGui method has to know what type IComponent extends ! * (to call appropriate methods). That implies that if definition of ! * IComponent changes all clients of IWindow, which uses this method, ! * have to be changed too. */ ! public JComponent getGui(); } --- 48,71 ---- /** Return window implementation. ! * * Window is abstract object, that delegates all its operations to the ! * low level window object. If primitive's methods aren't sufficent ! * to perform all available operations, client can access directly to ! * low level object (this way is not very recomended because code will ! * depend on selected graphical toolkit). ! * <p> ! * To get type correct instance, this method uses caster object, that ! * perfoms typesafe casting and trows CalssCastException if low level ! * object is not type compatible. This method is defined in generics ! * way to handle any type of low level objects. User of this method ! * should use concrete object that implements ICaster interface. ! * ! * @see ICaster ! * @param caster Caster object that performs safe casting. ! * @param <T> Generic type depending on caster instance. ! * @return Gui specific instance. ! * @throws ClassCastException If caster is not able to safely cast to ! * T type. */ ! public <T> T getGui(ICaster<T> caster)throws ClassCastException; } Index: ILayout.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ILayout.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ILayout.java 4 Sep 2005 19:04:59 -0000 1.3 --- ILayout.java 15 Sep 2005 18:11:02 -0000 1.4 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.4 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.3 2005/09/04 19:04:59 mstsxfx * ILayout interface invalidate for this moment. *************** *** 18,24 **** package exfex.common.displaysystem; - import javax.swing.*; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; /** Low level layout interface. --- 22,25 ---- *************** *** 34,39 **** --- 35,42 ---- * TODO: DON'T use this at the moment. Client should create Layout by himself. * + * <pre> * Changes: * 31.8.2005 msts - created + * </pre> */ public interface ILayout Index: ILabel.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ILabel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ILabel.java 4 Sep 2005 19:02:16 -0000 1.2 --- ILabel.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/09/04 19:02:16 mstsxfx * interface definition changed *************** *** 14,22 **** package exfex.common.displaysystem; - import exfex.common.displaysystem.*; /** Interface for label graphic primitive. * ! * This interface groups all functionality of the label. */ public interface ILabel extends IWindow, ITextAble --- 18,29 ---- package exfex.common.displaysystem; /** Interface for label graphic primitive. * ! * This interface groups all functionality of the label. This is type of ! * implementation independed labels. If user needs to use facility that can't be ! * used with methods defined in inherited interfaces, he should use getGui ! * method and use methods on low level primitives object. ! * */ public interface ILabel extends IWindow, ITextAble Index: SessionNode.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/SessionNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionNode.java 31 Aug 2005 17:59:11 -0000 1.2 --- SessionNode.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/31 17:59:11 mstsxfx * design changes and documentation *************** *** 14,19 **** import java.util.*; ! import exfex.common.pluginsystem.*; ! import exfex.common.displaysystem.*; /** Helper method for session tree. --- 18,22 ---- import java.util.*; ! /** Helper method for session tree. *************** *** 24,31 **** * It implements equals method to compare two SessionNode objects. * - * @author msts * * Changes: * 20.8.2005 msts - created */ public class SessionNode --- 27,37 ---- * It implements equals method to compare two SessionNode objects. * * + * <pre> * Changes: * 20.8.2005 msts - created + * </pre> + * + * @author msts */ public class SessionNode *************** *** 47,53 **** /** Constructor. - * @param session Session for node. * * Sets session field to given one. */ public SessionNode(ISession session) --- 53,60 ---- /** Constructor. * * Sets session field to given one. + * + * @param session Session for node. */ public SessionNode(ISession session) *************** *** 56,60 **** } ! /** Returns session instance. */ public ISession getSession() { --- 63,70 ---- } ! /** Returns session instance. ! * ! * @return Session object. ! */ public ISession getSession() { *************** *** 63,73 **** /** Compares for equality. - * @param node Node to compare. * * Compares itself with given node. Nodes are same iff they contain * same session object (compares referencies). * ! * @return true if node is same as this. ! * @return false otherwise. */ public boolean equals(SessionNode node)//{{{ --- 73,82 ---- /** Compares for equality. * * Compares itself with given node. Nodes are same iff they contain * same session object (compares referencies). * ! * @param node Node to compare. ! * @return true if node is same as this, otherwise false. */ public boolean equals(SessionNode node)//{{{ *************** *** 81,92 **** * * Returns all direct descendants (memebers of children list). ! * <br> * NOTE: Doesn't work recursively for all children. ! * <br> * NOTE: Makes copy of list, so changes made to the returned list * doesn't affect children in list. * ! * @return An array of all direct children. ! * @return null of no child is found. */ public List<SessionNode> getChildren()//{{{ --- 90,100 ---- * * Returns all direct descendants (memebers of children list). ! * <p> * NOTE: Doesn't work recursively for all children. ! * <p> * NOTE: Makes copy of list, so changes made to the returned list * doesn't affect children in list. * ! * @return An array of all direct children or null if no child is found. */ public List<SessionNode> getChildren()//{{{ *************** *** 100,112 **** /** Adds child. - * @param node Node to insert as child. * * If there is not any node inserted yet, creates children list. * Inserts node to the children list. Node must be non null. ! * * TODO null parameter * ! * @return true if successfull insert. ! * @return false otherwise. */ public boolean addChild(SessionNode node)//{{{ --- 108,119 ---- /** Adds child. * * If there is not any node inserted yet, creates children list. * Inserts node to the children list. Node must be non null. ! * <p> * TODO null parameter * ! * @param node Node to insert as child. ! * @return true if successfull insert, otherwise false. */ public boolean addChild(SessionNode node)//{{{ *************** *** 123,133 **** /** Removes given node from children. - * @param node Node to remove. * * Finds out if node is member of children list and if so, removes it * from the list. If node is not memeber or is null, silently return. * ! * @return true if removed. ! * @return false otherwise. */ public boolean removeChild(SessionNode node)//{{{ --- 130,139 ---- /** Removes given node from children. * * Finds out if node is member of children list and if so, removes it * from the list. If node is not memeber or is null, silently return. * ! * @param node Node to remove. ! * @return true if removed or false otherwise. */ public boolean removeChild(SessionNode node)//{{{ Index: IEventDispatcher.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IEventDispatcher.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IEventDispatcher.java 31 Aug 2005 18:05:19 -0000 1.1 --- IEventDispatcher.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/08/31 18:05:19 mstsxfx * interface created *************** *** 9,20 **** package exfex.common.displaysystem; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; /** Basic interface for Event dispatcher. */ public interface IEventDispatcher { ! /** Start to process events. */ public int startLoop(); --- 13,27 ---- package exfex.common.displaysystem; /** Basic interface for Event dispatcher. + * + * TODO: this is just scratch. */ public interface IEventDispatcher { ! /** Starts to process events. ! * ! * @return Return code of dispatcher. ! */ public int startLoop(); Index: IEvent.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IEvent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IEvent.java 22 Aug 2005 20:28:55 -0000 1.1 --- IEvent.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 4,7 **** --- 4,11 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/08/22 20:28:55 mstsxfx * Display system stuff add *************** *** 11,22 **** package exfex.common.displaysystem; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; /** Low level event interface. * ! * This interface defines basic lowlevel event object. It should define it by ! * extending some already implemented root object in event hierarchy. ! * This is used as abstraction upon all events. */ public interface IEvent --- 15,25 ---- package exfex.common.displaysystem; /** Low level event interface. * ! * This interface defines basic lowlevel event object. ! * ! * <p> ! * TODO: this is just scratch. */ public interface IEvent Index: IButtonFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IButtonFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IButtonFactory.java 3 Sep 2005 13:28:00 -0000 1.1 --- IButtonFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/03 13:28:00 mstsxfx * factories created *************** *** 11,17 **** import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; ! /** Interface of all plugins that wants to create buttons. * * All plugins that wants to create buttons should implement this interface. --- 15,21 ---- import exfex.common.pluginsystem.*; ! ! /** Interface for all plugins that wants to create buttons. * * All plugins that wants to create buttons should implement this interface. *************** *** 19,27 **** * low level getInstance method and casting. * Plugins of this type should register themselfs to the DisplayManager. */ public interface IButtonFactory extends IPlugin { /** Returns button object. - * @param context Context for button. * * Creates instance of Button object. Uses getInstance method from --- 23,36 ---- * low level getInstance method and casting. * Plugins of this type should register themselfs to the DisplayManager. + * + * <pre> + * Changes: + * </pre> + * + * @author msts */ public interface IButtonFactory extends IPlugin { /** Returns button object. * * Creates instance of Button object. Uses getInstance method from *************** *** 29,34 **** * around getInstance with no special logic. * * @return Button. */ ! IButton getButton(IContext context); } --- 38,45 ---- * around getInstance with no special logic. * + * @param context Context for button. * @return Button. + * @throws PluginException if can't create button. */ ! IButton getButton(IContext context)throws PluginException; } Index: ISessionManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ISessionManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ISessionManager.java 31 Aug 2005 15:49:20 -0000 1.2 --- ISessionManager.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/31 15:49:20 mstsxfx * documentation update *************** *** 16,25 **** import exfex.common.pluginsystem.*; import exfex.common.security.*; ! import exfex.common.displaysystem.*; /** Interface for Session manager. * * Interface for plugins that want to be Session managers. ! * <br> * <b>Responsibilies</b>:<br> * Implementators have to keep tree of all active sessions (created by --- 20,29 ---- import exfex.common.pluginsystem.*; import exfex.common.security.*; ! /** Interface for Session manager. * * Interface for plugins that want to be Session managers. ! * <p> * <b>Responsibilies</b>:<br> * Implementators have to keep tree of all active sessions (created by *************** *** 29,35 **** * killing of all session children). To find out all sessions factories * (plugins that implements ISessionFactory) use getSessionFactories method. ! * <br> * SessionManager should log all importat information using SESSMNG_LOGGER. ! * <br> * <b>Usage</b>:<br> * <ul> --- 33,39 ---- * killing of all session children). To find out all sessions factories * (plugins that implements ISessionFactory) use getSessionFactories method. ! * <p> * SessionManager should log all importat information using SESSMNG_LOGGER. ! * <p> * <b>Usage</b>:<br> * <ul> *************** *** 72,87 **** * NOTE: Implementator should perform permissions check TODO * - * @author msts * * Changes: * 20.8.2005 msts - created */ public interface ISessionManager extends IPlugin,IAcceptPlugin { /** Returns all first level sessions. - * @param id Identification object of caller. * * Returns all sessions created by registerSession method. ! * <br> * NOTE: All returned sessions was registered in the moment of method * call. This means that some of returned session may not exist in --- 76,94 ---- * NOTE: Implementator should perform permissions check TODO * * + * <pre> * Changes: * 20.8.2005 msts - created + * </pre> + * + * + * @author msts */ public interface ISessionManager extends IPlugin,IAcceptPlugin { /** Returns all first level sessions. * * Returns all sessions created by registerSession method. ! * <p> * NOTE: All returned sessions was registered in the moment of method * call. This means that some of returned session may not exist in *************** *** 91,94 **** --- 98,102 ---- * TODO: consider id and capabilities, exceptions * + * @param id Identification object of caller. * @return Array of session objects. */ *************** *** 96,101 **** /** Registers new session. - * @param id Identification object of caller. - * @param sessionplugin Plugin (factory) for session. * * Creates new session using sessionplugin (calls --- 104,107 ---- *************** *** 105,111 **** * fields and finaly session's parent (to null) and state (to CREATED). * ! * <br> * TODO: consider id and capabilities, exceptions * * @return new session. */ --- 111,119 ---- * fields and finaly session's parent (to null) and state (to CREATED). * ! * <p> * TODO: consider id and capabilities, exceptions * + * @param id Identification object of caller. + * @param sessionplugin Plugin (factory) for session. * @return new session. */ *************** *** 113,119 **** /** Register new subsession. - * @param id Identification object of caller. - * @param session Parent session. - * @param sessionplugin Plugin (factory) for session. * * This method will create new subsession of given session using --- 121,124 ---- *************** *** 123,130 **** * When session is created, sets session's SessionManager, pluginManager * and session's parent (to session) and state (to CREATED). ! * @see IPlugin#getInstance ! * <br> * TODO: consider id and capabilities, exceptions * * @return new session. */ --- 128,139 ---- * When session is created, sets session's SessionManager, pluginManager * and session's parent (to session) and state (to CREATED). ! * ! * <p> * TODO: consider id and capabilities, exceptions * + * @see IPlugin#getInstance + * @param id Identification object of caller. + * @param session Parent session. + * @param sessionplugin Plugin (factory) for session. * @return new session. */ *************** *** 132,137 **** /** Kills given session. - * @param id Identification object of caller. - * @param session Session to kill. * * Destroy given session. --- 141,144 ---- *************** *** 152,163 **** * be removed from the session tree and all its children should be * closed too. ! * <br> * NOTE: don't use children kill method, becase it can call killSession * method! Rather use child close method. * ! * <br> * TODO: consider id and capabilities, exceptions * * @see ISession#kill */ public void killSession(IIdentity id, ISession session); --- 159,172 ---- * be removed from the session tree and all its children should be * closed too. ! * <p> * NOTE: don't use children kill method, becase it can call killSession * method! Rather use child close method. * ! * <p> * TODO: consider id and capabilities, exceptions * * @see ISession#kill + * @param id Identification object of caller. + * @param session Session to kill. */ public void killSession(IIdentity id, ISession session); *************** *** 167,172 **** * Asks IAcceptPlugin interface for all plugins with ISessionFactory * type. */ ! public List<ISessionFactory> getSessionFactories(); } --- 176,184 ---- * Asks IAcceptPlugin interface for all plugins with ISessionFactory * type. + * + * @return Returnes all factories (plugins) for sessions. + * @throws PluginException if no session factory is registered. */ ! public List<ISessionFactory> getSessionFactories()throws PluginException; } Index: IPrimitivesFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IPrimitivesFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IPrimitivesFactory.java 4 Sep 2005 19:07:00 -0000 1.3 --- IPrimitivesFactory.java 15 Sep 2005 18:11:02 -0000 1.4 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.4 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.3 2005/09/04 19:07:00 mstsxfx * Layout removed *************** *** 18,44 **** import java.util.*; import exfex.common.pluginsystem.*; ! import exfex.common.displaysystem.*; /** Interface for primitives factory plugins. * * Implementator (plugin) of this interface should create (with help of * DisplayManager) instances of layouts, graphic primitives and event ! * dispatchers. As return type it will use proxy interface for each ! * layout (ILayout), primitive (e.g. IButton, ILabel), dispatcher ! * (IEventDispatcher). ! * <br> * NOTE: This is the way how to use primitives in primitives' implementation * independed way (Button may be SWING button or HTML button, ...). To use * full facilities of returned implementation you can call "primitive".getGui() * method. ! * ! * @see IWindow#getGui ! * <br> * NOTE: Please use this plugin interface to create GUI's elements and don't * use DisplayManager directly (code will be cleaner). * - * @author msts * * Changes: */ public interface IPrimitivesFactory extends IPlugin --- 22,73 ---- import java.util.*; import exfex.common.pluginsystem.*; ! /** Interface for primitives factory plugins. * + * This interface stands for high level producer of specialized graphic + * primitives. + * <p> * Implementator (plugin) of this interface should create (with help of * DisplayManager) instances of layouts, graphic primitives and event ! * dispatchers. As return type it proxy interface for each primitives is used ! * (layout (ILayout), primitive (e.g. IButton, ILabel), dispatcher ! * (IEventDispatcher)) to be implementation independed. ! * <p> ! * <b>Configuration</b>:<br> ! * Each factory method has one parameter which stands for configuration (using ! * java Properties class). This assumes arbitrary number of string pairs (name ! * and value). These may (but don't have to) be used for configuration of ! * primitive. Unrecognized names should be ignored. Incorect values should ! * produce kind of warning or produce total failure of primitives creation. ! * This depends on implementator. Plugin should document what settings accepts, ! * but should also keep some standards. ! * <p> ! * <b>Configuration standards</b>: ! * <ul> ! * <li>TEXT - Value is caption of primitives (uses ITextAble interface to set ! * value). ! * <li>VISIBLE - Value is string convertable to boolean (uses IWindow interface ! * to set value). ! * <li>ENABLED - Value is string convertable to boolean (uses IWindow interface ! * to set value). ! * </ul> ! * <p> ! * <b>Final notes</b><br> * NOTE: This is the way how to use primitives in primitives' implementation * independed way (Button may be SWING button or HTML button, ...). To use * full facilities of returned implementation you can call "primitive".getGui() * method. ! * <p> * NOTE: Please use this plugin interface to create GUI's elements and don't * use DisplayManager directly (code will be cleaner). * * + * <pre> * Changes: + * </pre> + * + * @see IWindow#getGui + * @author msts */ public interface IPrimitivesFactory extends IPlugin *************** *** 46,72 **** /** Creates plugin depended button. - * @param setting Setting object for graphic primitive. * * Creates button according plugin logic and use setting (Properties) * object to initialize basic values (size, caption and so on). ! * <br> * Button is considered to be staleless primitive which can triger * at least onClick event. * * @return Instance of initialized button. */ ! public IButton getButton(Properties setting); /** Creates plugin denpeded label. - * @param setting Setting object for graphic primitive. * * Creates Label according plugin logic and use setting (Properties) * object to initialize basic values (size, caption and so on). ! * <br> * Label is considered to be staleless and eventless primitive. * * @return Instance of initialized label. */ ! public ILabel getLabel(Properties setting); } --- 75,103 ---- /** Creates plugin depended button. * * Creates button according plugin logic and use setting (Properties) * object to initialize basic values (size, caption and so on). ! * <p> * Button is considered to be staleless primitive which can triger * at least onClick event. * + * @param setting Setting object for graphic primitive. * @return Instance of initialized button. + * @throws PluginException if corresponding plugin can't be found. */ ! public IButton getButton(Properties setting)throws PluginException; /** Creates plugin denpeded label. * * Creates Label according plugin logic and use setting (Properties) * object to initialize basic values (size, caption and so on). ! * <p> * Label is considered to be staleless and eventless primitive. * + * @param setting Setting object for graphic primitive. * @return Instance of initialized label. + * @throws PluginException if corresponding plugin can't be found. */ ! public ILabel getLabel(Properties setting)throws PluginException; } Index: IDisplayManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IDisplayManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IDisplayManager.java 4 Sep 2005 19:08:31 -0000 1.4 --- IDisplayManager.java 15 Sep 2005 18:11:02 -0000 1.5 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.5 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.4 2005/09/04 19:08:31 mstsxfx * New methods *************** *** 23,27 **** import java.util.*; import exfex.common.pluginsystem.*; ! import exfex.common.displaysystem.*; /** Interface for display manager. --- 27,31 ---- import java.util.*; import exfex.common.pluginsystem.*; ! /** Interface for display manager. *************** *** 47,52 **** * directly is to ask for certain primitives factory object and use this * in future work. ! * <br> ! * <b>Usage</b>:<br> * <ul> * <li>Primitives implementators - you can get primitives impl. by getPrimitive --- 51,56 ---- * directly is to ask for certain primitives factory object and use this * in future work. ! * <p> ! * <b>Usage</b>: * <ul> * <li>Primitives implementators - you can get primitives impl. by getPrimitive *************** *** 58,78 **** * </ul> * ! * @author msts ! * * Changes: * 14.8.2005 msts - created */ public interface IDisplayManager extends IPlugin, IAcceptPlugin { ! /** Returns all implementators of IButtonFactory interface. */ ! public List<IButtonFactory> getButtons(); ! /** Returns all implementators of ILabelFactory interface. */ ! public List<ILabelFactory> getLabels(); ! /** Returns all implementators of IPrimitvesFactory interface. */ ! public List<IPrimitivesFactory> getPrimitivesFactory(); ! /** Returns implementator of IPrimitvesFactory interface with given name. */ ! public IPrimitivesFactory getPrimitiveFactory(String name); } --- 62,107 ---- * </ul> * ! * ! * <pre> * Changes: * 14.8.2005 msts - created + * </pre> + * + * @author msts */ public interface IDisplayManager extends IPlugin, IAcceptPlugin { ! /** Returns all implementators of IButtonFactory interface. ! * ! * @return List of factories. ! * ! * @throws PluginException if no buttons are registered. ! */ ! public List<IButtonFactory> getButtons()throws PluginException; ! /** Returns all implementators of ILabelFactory interface. ! * ! * @return List of factories. ! * @throws PluginException if no labels are registered. ! */ ! public List<ILabelFactory> getLabels()throws PluginException; ! /** Returns all implementators of IPrimitvesFactory interface. ! * ! * @return List of factories. ! * @throws PluginException if no primitives factories are registered. ! */ ! public List<IPrimitivesFactory> getPrimitivesFactory()throws PluginException; ! /** Returns implementator of IPrimitvesFactory interface with given name. ! * ! * Returns concrete PrimitivesFactory object created by plugin with ! * given name. ! * ! * @param name Name of concrete Primitives factory. ! * @return Primitives factory instance. ! * ! * @throws PluginException if factory with given name is not registered. ! */ ! public IPrimitivesFactory getPrimitiveFactory(String name)throws PluginException; } Index: ILayoutFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ILayoutFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ILayoutFactory.java 3 Sep 2005 13:28:00 -0000 1.1 --- ILayoutFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/03 13:28:00 mstsxfx * factories created *************** *** 11,15 **** import exfex.common.pluginsystem.*; ! import exfex.common.displaysystem.*; /** Interface of all plugins that wants to create layouts. --- 15,19 ---- import exfex.common.pluginsystem.*; ! /** Interface of all plugins that wants to create layouts. *************** *** 23,27 **** { /** Returns layout object. - * @param context Context for layout. * * Creates instance of Layout object. Uses getInstance method from --- 27,30 ---- *************** *** 29,32 **** --- 32,36 ---- * around getInstance with no special logic. * + * @param context Context for layout. * @return Layout. */ Index: ISession.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ISession.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ISession.java 31 Aug 2005 15:48:39 -0000 1.2 --- ISession.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/31 15:48:39 mstsxfx * new method close *************** *** 15,19 **** import exfex.common.pluginsystem.*; ! import exfex.common.displaysystem.*; /** Basic interface for all session plugins. --- 19,23 ---- import exfex.common.pluginsystem.*; ! /** Basic interface for all session plugins. *************** *** 34,38 **** * ever. When Session is closed all subsessions are forced to close too. * Subsession inherits setting from parent setting, but may change values. ! * <br> * <b>Usage</b>:<br> * Only way to get proper session object instance is to ask SessionManager to --- 38,42 ---- * ever. When Session is closed all subsessions are forced to close too. * Subsession inherits setting from parent setting, but may change values. ! * <p> * <b>Usage</b>:<br> * Only way to get proper session object instance is to ask SessionManager to *************** *** 59,63 **** * objects, stop event dispatcher) and remove from session tree call kill * method. If you want just to discTo find out parent session call getParent method. ! * <br> * <b>Initialization</b>:<br> * Session manager can use set* methods to set sessions' basic fields. You --- 63,67 ---- * objects, stop event dispatcher) and remove from session tree call kill * method. If you want just to discTo find out parent session call getParent method. ! * <p> * <b>Initialization</b>:<br> * Session manager can use set* methods to set sessions' basic fields. You *************** *** 67,86 **** * All other managers can be get from those managers. * - * @see start - * @see kill - * @see sendEvent - * @see getState - * @see getParent - * @see SessionState - * - * @author msts * * Changes: * 20.8.2005 msts - created */ public interface ISession { /** Startup method. - * @param args Array of parameters. * * Initialize all graphic primitives (buttons, labels, ...). To find --- 71,93 ---- * All other managers can be get from those managers. * * + * <pre> * Changes: * 20.8.2005 msts - created + * </pre> + * + * + * @see ISession#start + * @see ISession#kill + * @see ISession#sendEvent + * @see ISession#getState + * @see ISession#getParentSession + * @see ISession#getState + * + * @author msts */ public interface ISession { /** Startup method. * * Initialize all graphic primitives (buttons, labels, ...). To find *************** *** 90,98 **** * Start should fail if session's state is not CREATED (first call of * start) or CLOSED (session was closed and we want to start it again). ! * <br> * This method should be blocking if session is modal dialog or similar * stuff that waits until some actions are performed. If session should * coexist with other sessions it should create separate thread and * imediately return. */ public void start(String [] args); --- 97,107 ---- * Start should fail if session's state is not CREATED (first call of * start) or CLOSED (session was closed and we want to start it again). ! * <p> * This method should be blocking if session is modal dialog or similar * stuff that waits until some actions are performed. If session should * coexist with other sessions it should create separate thread and * imediately return. + * + * @param args Array of parameters. */ public void start(String [] args); *************** *** 145,149 **** /** Sebds event to the session. - * @param event Event to send. * * Sends event to the event dispatcher which will handle it. --- 154,157 ---- *************** *** 151,154 **** --- 159,163 ---- * Otherwise warning or error should be reported. * + * @param event Event to send. */ public void sendEvent(IEvent event); *************** *** 157,165 **** * * @see SessionState */ public SessionState getState(); /** Sets state of the session. - * @param state New state to set. * * This method will set state for session. Session manager should set --- 166,176 ---- * * @see SessionState + * + * @return State of the session. + * */ public SessionState getState(); /** Sets state of the session. * * This method will set state for session. Session manager should set *************** *** 167,175 **** * This method should ensure that no change from FINISH, no lower state * change from CREATED can be made. */ public void setState(SessionState state); /** Sets session manager that created this session. - * @param manager Session manager. * * This method will set session manager that created this session. --- 178,187 ---- * This method should ensure that no change from FINISH, no lower state * change from CREATED can be made. + * + * @param state New state to set. */ public void setState(SessionState state); /** Sets session manager that created this session. * * This method will set session manager that created this session. *************** *** 177,185 **** * This method should succede only if state is NONE, otherwise it * should report an error (session manager doesn't change in time). */ public void setSessionManager(ISessionManager manager); /** Sets plugin manager. - * @param manager PluginManager instance. * * Sets plugin manager to the session to be able to find other --- 189,199 ---- * This method should succede only if state is NONE, otherwise it * should report an error (session manager doesn't change in time). + * + * @param manager Session manager. + * */ public void setSessionManager(ISessionManager manager); /** Sets plugin manager. * * Sets plugin manager to the session to be able to find other *************** *** 188,191 **** --- 202,207 ---- * Same as in setSessionManager this method should suceede iff * state is NONE. + * + * @param manager PluginManager instance. */ public void setPluginManager(PluginManager manager); *************** *** 198,206 **** * (methods registerSession or execSession). * This method should suceede iff state is NONE. */ public ISession getParentSession(); /** Sets parent of the session. - * @param parent Parent of this session. * * This method should be called when registering or executing new --- 214,223 ---- * (methods registerSession or execSession). * This method should suceede iff state is NONE. + * + * @return Parent session or null if top level session. */ public ISession getParentSession(); /** Sets parent of the session. * * This method should be called when registering or executing new *************** *** 208,211 **** --- 225,231 ---- * should be null. * This method should suceede iff state is NONE. + * + * @param parent Parent of this session. + * */ public void setParentSession(ISession parent); --- NEW FILE: ICaster.java --- /** * $RCSfile: ICaster.java,v $ * * $Log: ICaster.java,v $ * Revision 1.1 2005/09/15 18:11:02 mstsxfx * documentation corrected * som code fixing * */ package exfex.common.displaysystem; /** * ICaster to provide typesafe casting. * * This interface is designed to be basic type for type safe casting object. * Implementators are responsible for type depending way cast from given object, * using method cast, or throw ClassCast exception if givem object is not type * compatible. * <p> * Generic declaration garantees code clearness and type safety. Primary usage * is for Primitives object (those which extends IWindow interface) in case when * we need to acces their low level objects. * * * <pre> * Example: * * class JButtonCaster implenets ICaster<JButton> * { * JButton cast(Object o)throws ClassCastException * { * if(o instanceof JButton) * return (JButton)o; * throw new ClassCastException(new String("Incompatible type")); * } * } * . * . * . * * try * { * JButton button=primitive.getGui(new JButtonCaster()); * } catch (Exception e) * { * // handle exception * } * </pre> * * <pre> * TODO: extend IPlugin interface (make plugin-able) * TODO: insert to CVS * * Changes: * 9.9.2005 msts - created * </pre> * * * @param <T> Generic type of caster. * @see IWindow#getGui * @see ICaster#cast * * @author msts * */ public interface ICaster<T> { /** Cast given object to T type. * @param o Instance to cast. * * @return Cast instance with T type. * * @throws ClassCastException if o is not type compatible with T. */ public T cast(Object o)throws ClassCastException; } Index: IComponent.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IComponent.java 4 Sep 2005 18:59:14 -0000 1.2 --- IComponent.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/09/04 18:59:14 mstsxfx * Invalidate for this moment (We will use direct types not general *************** *** 14,29 **** package exfex.common.displaysystem; - import javax.swing.*; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; /** Low level window interface. * ! * This interface defines basic lowlevel displaable object. It should be defined ! * it by extending some such class object. This abstraction helps us to create ! * different styles of gui (outputs using SWING, HTML, ...) without need to ! * change display core stuff. ! * Instance of this object is returned by getGui method from basic IWindow ! * interface - so all displayable objects in display system. */ public interface IComponent// extends JComponent --- 18,31 ---- package exfex.common.displaysystem; /** Low level window interface. * ! * This interface defines basic lowlevel displayable object. This interface is ! * defined to make implementation independed way to work with graphic ! * primitives. ! * <pre> ! * Changes: ! * 14.9.2005 msts - ready to remove from project ! * </pre> */ public interface IComponent// extends JComponent Index: IEventOnClick.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IEventOnClick.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IEventOnClick.java 14 Aug 2005 20:05:58 -0000 1.1 --- IEventOnClick.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/08/14 20:05:58 mstsxfx * Basic interfaces for graphick primitives *************** *** 11,17 **** package exfex.common.displaysystem; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; - /** Basic interface for onClick event handling. * --- 15,18 ---- *************** *** 19,22 **** public interface IEventOnClick { ! // TODO } --- 20,30 ---- public interface IEventOnClick { ! /** Method which handles click event. ! * ! * Each primitives that wants to handle click action (event) should ! * implement this method. ! * ! * @param event Object that holds information about event. ! */ ! public void handleClick(IEvent event); } Index: IButton.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IButton.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IButton.java 4 Sep 2005 19:02:16 -0000 1.2 --- IButton.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/09/04 19:02:16 mstsxfx * interface definition changed *************** *** 14,26 **** package exfex.common.displaysystem; - import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; - /** Interface for button primitive. * ! * @author msts ! * * Changes: * 14.8.2005 msts - created */ public interface IButton extends IWindow, ITextAble --- 18,35 ---- package exfex.common.displaysystem; /** Interface for button primitive. * ! * Interface to collect all button facilities. This is type of implementation ! * independed buttons. If user needs to use facility that can't be used with ! * methods defined in inherited interfaces, he should use getGui method and ! * use methods on low level primitives object. ! * ! * <pre> * Changes: * 14.8.2005 msts - created + * </pre> + * + * + * @author msts */ public interface IButton extends IWindow, ITextAble Index: ILabelFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ILabelFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ILabelFactory.java 3 Sep 2005 13:28:00 -0000 1.1 --- ILabelFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/03 13:28:00 mstsxfx * factories created *************** *** 11,15 **** import exfex.common.pluginsystem.*; ! import exfex.common.displaysystem.*; /** Interface of all plugins that wants to create labels. --- 15,19 ---- import exfex.common.pluginsystem.*; ! /** Interface of all plugins that wants to create labels. *************** *** 23,27 **** { /** Returns label object. - * @param context Context for label. * * Creates instance of Label object. Uses getInstance method from --- 27,30 ---- *************** *** 29,34 **** * around getInstance with no special logic. * * @return Label. */ ! ILabel getLabel(IContext context); } --- 32,39 ---- * around getInstance with no special logic. * + * @param context Context for label. * @return Label. + * @throws PluginException if can't create label. */ ! ILabel getLabel(IContext context)throws PluginException; } Index: ITextAble.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ITextAble.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ITextAble.java 4 Sep 2005 19:01:22 -0000 1.1 --- ITextAble.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/04 19:01:22 mstsxfx * Interface for primitives with text *************** *** 10,14 **** package exfex.common.displaysystem; ! import exfex.common.displaysystem.*; /** Interface for graphic primitives, which can contain text. --- 14,18 ---- package exfex.common.displaysystem; ! /** Interface for graphic primitives, which can contain text. *************** *** 16,28 **** * Use getText to find out actualy set text and setText to set new text. * ! * @author msts ! * * Changes: * 4.9.2005 msts - created */ public interface ITextAble { public String getText(); ! public void setText(String str); } --- 20,49 ---- * Use getText to find out actualy set text and setText to set new text. * ! * ! * <pre> * Changes: * 4.9.2005 msts - created + * </pre> + * + * @author msts */ public interface ITextAble { + /** Returns text. + * + * Returns text set by setText method. + * + * @return String representation of the text. + */ public String getText(); ! ! /** Sets text. ! * ! * Sets new text and returns old one. ! * ! * @param str New string. ! * @return Old text. ! */ ! public String setText(String str); } Index: SessionState.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/SessionState.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionState.java 31 Aug 2005 15:48:05 -0000 1.2 --- SessionState.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/31 15:48:05 mstsxfx * new session state CLOSED *************** *** 13,17 **** package exfex.common.displaysystem; - import exfex.common.displaysystem.*; /** States of session. --- 17,20 ---- *************** *** 27,31 **** * <li>FINISH - session has destroyed all created stuff and it is ready to be * removed from session tree. - * </ul> */ public enum SessionState { NONE, CREATED, INITIALIZED, CLOSED, FINISH}; --- 30,33 ---- Index: ISessionFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ISessionFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ISessionFactory.java 22 Aug 2005 20:28:55 -0000 1.1 --- ISessionFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/08/22 20:28:55 mstsxfx * Display system stuff add *************** *** 11,17 **** import exfex.common.pluginsystem.*; - import exfex.common.displaysystem.*; ! /** Interface of all plugins that wants to create sessions. * * All plugins that wants to create sessions should implement this interface. --- 15,21 ---- import exfex.common.pluginsystem.*; ! ! /** Interface for all plugins that wants to create sessions. * * All plugins that wants to create sessions should implement this interface. *************** *** 23,27 **** { /** Returns session object. - * @param context Context for session. * * Creates instance of Session object. Uses getInstance method from --- 27,30 ---- *************** *** 29,32 **** --- 32,36 ---- * around getInstance with no special logic. * + * @param context Context for session. * @return Session. */ |
Update of /cvsroot/exfex/exfex/source/exfex/common/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5834/source/exfex/common/plugins Modified Files: SWINGPrimitivesFactory.java SessionManager.java SWINGButtonFactory.java BasicSessionFactory.java DisplayManager.java SWINGLabelFactory.java Log Message: documentation corrected som code fixing Index: DisplayManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/plugins/DisplayManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DisplayManager.java 4 Sep 2005 18:56:23 -0000 1.1 --- DisplayManager.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/04 18:56:23 mstsxfx * Display manager created *************** *** 46,54 **** /** Returns all button plugins. */ ! synchronized public List<IButtonFactory> getButtons()//{{{ { // Makes copy of returned list from getByIface List<IButtonFactory> list=new LinkedList<IButtonFactory>(); PluginList plglist=getByIface(IButtonFactory.class); ListIterator<IPlugin> iter=plglist.listIterator(); while(iter.hasNext()) --- 50,60 ---- /** Returns all button plugins. */ ! synchronized public List<IButtonFactory> getButtons()throws PluginException//{{{ { // Makes copy of returned list from getByIface List<IButtonFactory> list=new LinkedList<IButtonFactory>(); + PluginList plglist=getByIface(IButtonFactory.class); + ListIterator<IPlugin> iter=plglist.listIterator(); while(iter.hasNext()) *************** *** 61,65 **** /** Returns all label plugins. */ ! synchronized public List<ILabelFactory> getLabels()//{{{ { // Makes copy of returned list from getByIface --- 67,71 ---- /** Returns all label plugins. */ ! synchronized public List<ILabelFactory> getLabels()throws PluginException //{{{ { // Makes copy of returned list from getByIface *************** *** 76,80 **** /** Returnes list of all PrimitivesFactory implementators. */ ! synchronized public List<IPrimitivesFactory> getPrimitivesFactory()//{{{ { // Makes copy of returned list from getByIface --- 82,86 ---- /** Returnes list of all PrimitivesFactory implementators. */ ! synchronized public List<IPrimitivesFactory> getPrimitivesFactory()throws PluginException //{{{ { // Makes copy of returned list from getByIface *************** *** 92,103 **** /** Returns implementator of PrimitivesFactory (plugin) with given name. - * @param name Name of the plugin. * * Try to find IPrimitivesFactory implementator (plugin) witg given * name. * * @return PrimitivesFactory implementator or null if no such exists. */ ! synchronized public IPrimitivesFactory getPrimitiveFactory(String name) { return (IPrimitivesFactory)getByName(IPrimitivesFactory.class,name); --- 98,109 ---- /** Returns implementator of PrimitivesFactory (plugin) with given name. * * Try to find IPrimitivesFactory implementator (plugin) witg given * name. * + * @param name Name of the plugin. * @return PrimitivesFactory implementator or null if no such exists. */ ! synchronized public IPrimitivesFactory getPrimitiveFactory(String name)throws PluginException { return (IPrimitivesFactory)getByName(IPrimitivesFactory.class,name); *************** *** 119,128 **** /** Returns instance of manager. - * @param context Context of instancing. * * Returns singleton instance of the manager. ! * <br> * NOTE: Ignores context parameter. * * @return SessionManager instance. */ --- 125,134 ---- /** Returns instance of manager. * * Returns singleton instance of the manager. ! * <p> * NOTE: Ignores context parameter. * + * @param context Context of instancing. * @return SessionManager instance. */ *************** *** 138,142 **** public void registerMe() { ! manager.attach(this); } --- 144,156 ---- public void registerMe() { ! try ! { ! manager.attach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } *************** *** 147,151 **** public void unRegisterMe() { ! manager.dettach(this); } } --- 161,173 ---- public void unRegisterMe() { ! try ! { ! manager.dettach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } } Index: SWINGLabelFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/plugins/SWINGLabelFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SWINGLabelFactory.java 4 Sep 2005 18:55:47 -0000 1.1 --- SWINGLabelFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/04 18:55:47 mstsxfx * Created simple and ilustrative SWING primitive plugin *************** *** 24,30 **** } ! public void setText(String text) { label.setText(text); } --- 28,36 ---- } ! public String setText(String text) { + String old=getText(); label.setText(text); + return old; } *************** *** 54,60 **** } ! public JComponent getGui() { ! return (JComponent)label; } }//}}} --- 60,66 ---- } ! public <T> T getGui(ICaster<T> caster) { ! return caster.cast((Object)label); } }//}}} *************** *** 70,78 **** * <li>Registers itself to DisplayManager * </ul> - * - * @author msts * * Changes: * 4.9.2005 msts - created */ public class SWINGLabelFactory implements ILabelFactory --- 76,86 ---- * <li>Registers itself to DisplayManager * </ul> * + * <pre> * Changes: * 4.9.2005 msts - created + * </pre> + * + * @author msts */ public class SWINGLabelFactory implements ILabelFactory *************** *** 116,120 **** public void registerMe() { ! manager.attach(this); } --- 124,136 ---- public void registerMe() { ! try ! { ! manager.attach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } *************** *** 122,126 **** public void unRegisterMe() { ! manager.dettach(this); } --- 138,150 ---- public void unRegisterMe() { ! try ! { ! manager.dettach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } Index: SWINGButtonFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/plugins/SWINGButtonFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SWINGButtonFactory.java 4 Sep 2005 18:55:47 -0000 1.1 --- SWINGButtonFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/04 18:55:47 mstsxfx * Created simple and ilustrative SWING primitive plugin *************** *** 24,30 **** } ! public void setText(String text) { button.setText(text); } --- 28,36 ---- } ! public String setText(String text) { + String old=getText(); button.setText(text); + return old; } *************** *** 54,60 **** } ! public JComponent getGui() { ! return (JComponent)button; } --- 60,66 ---- } ! public <T> T getGui(ICaster<T> caster) { ! return caster.cast((Object)button); } *************** *** 75,83 **** * <li>Registers itself to the DisplayManager * </ul> - * - * @author msts * * Changes: * 4.9.2005 msts - created */ public class SWINGButtonFactory implements IButtonFactory --- 81,92 ---- * <li>Registers itself to the DisplayManager * </ul> * + * <pre> * Changes: * 4.9.2005 msts - created + * </pre> + * + * + * @author msts */ public class SWINGButtonFactory implements IButtonFactory *************** *** 113,117 **** public void registerMe() { ! manager.attach(this); } --- 122,134 ---- public void registerMe() { ! try ! { ! manager.attach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } *************** *** 119,123 **** public void unRegisterMe() { ! manager.dettach(this); } --- 136,148 ---- public void unRegisterMe() { ! try ! { ! manager.dettach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } Index: BasicSessionFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/plugins/BasicSessionFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicSessionFactory.java 4 Sep 2005 18:57:39 -0000 1.3 --- BasicSessionFactory.java 15 Sep 2005 18:11:02 -0000 1.4 *************** *** 8,14 **** * Iplementation of example session. * ! * @author msts ! * * NOTICE: not for casual usage, just as ilustration. */ class BasicSession implements ISession//{{{ --- 8,16 ---- * Iplementation of example session. * ! * <br> * NOTICE: not for casual usage, just as ilustration. + * + * + * @author msts */ class BasicSession implements ISession//{{{ *************** *** 22,25 **** --- 24,28 ---- private String title=null; + /** Default constructor. */ public BasicSession() { *************** *** 130,136 **** * Example of SessionFactory plugin. * - * @author msts * * NOTE: This is just example for ilustrative purposes. */ public class BasicSessionFactory implements ISessionFactory --- 133,141 ---- * Example of SessionFactory plugin. * * * NOTE: This is just example for ilustrative purposes. + * + * + * @author msts */ public class BasicSessionFactory implements ISessionFactory *************** *** 154,163 **** public void registerMe() { ! manager.attach(this); } public void unRegisterMe() { ! manager.dettach(this); } --- 159,184 ---- public void registerMe() { ! try ! { ! manager.attach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } public void unRegisterMe() { ! try ! { ! manager.dettach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } Index: SWINGPrimitivesFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/plugins/SWINGPrimitivesFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SWINGPrimitivesFactory.java 4 Sep 2005 18:55:47 -0000 1.1 --- SWINGPrimitivesFactory.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.2 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.1 2005/09/04 18:55:47 mstsxfx * Created simple and ilustrative SWING primitive plugin *************** *** 13,17 **** import exfex.common.pluginsystem.*; import exfex.common.displaysystem.*; ! import exfex.common.plugins.*; /** Plugin for SWING primitives creation. --- 17,21 ---- import exfex.common.pluginsystem.*; import exfex.common.displaysystem.*; ! /** Plugin for SWING primitives creation. *************** *** 33,40 **** * </ul> * ! * @author msts ! * * Changes: * 4.9.2005 msts - created */ public class SWINGPrimitivesFactory implements IPrimitivesFactory --- 37,46 ---- * </ul> * ! * <pre> * Changes: * 4.9.2005 msts - created + * </pre> + * + * @author msts */ public class SWINGPrimitivesFactory implements IPrimitivesFactory *************** *** 66,70 **** /** Creates SWING button and initialize it according setting. - * @param setting Setting object. * * Creates new SWING button. Initialize it according given setting. --- 72,75 ---- *************** *** 73,78 **** * <li>TEXT - sets text (property value) of the button * </ul> */ ! public IButton getButton(Properties setting)//{{{ { IButton result; --- 78,85 ---- * <li>TEXT - sets text (property value) of the button * </ul> + * + * @param setting Setting object. */ ! public IButton getButton(Properties setting)throws PluginException//{{{ { IButton result; *************** *** 80,92 **** // get button factory from display manager if not set yet if(buttonFactory==null) - { buttonFactory=(IButtonFactory)manager.getByName(IButtonFactory.class,"SWING button"); ! if(buttonFactory==null) ! { ! // Unable to find SWING button factory ! return null; ! } ! } result=buttonFactory.getButton(null); if(setting!=null) { --- 87,94 ---- // get button factory from display manager if not set yet if(buttonFactory==null) buttonFactory=(IButtonFactory)manager.getByName(IButtonFactory.class,"SWING button"); ! result=buttonFactory.getButton(null); + if(setting!=null) { *************** *** 110,114 **** /** Creates SWING label and initialize it according setting. - * @param setting Setting object. * * Creates new SWING label. Initialize it according given setting. --- 112,115 ---- *************** *** 117,122 **** * <li>TEXT - sets text (property value) of the label * </ul> */ ! public ILabel getLabel(Properties setting)//{{{ { ILabel result; --- 118,125 ---- * <li>TEXT - sets text (property value) of the label * </ul> + * + * @param setting Setting object. */ ! public ILabel getLabel(Properties setting)throws PluginException//{{{ { ILabel result; *************** *** 172,181 **** /** Returns instance of manager. - * @param context Context of instancing. * * Returns new instance of this class. ! * <br> * NOTE: Ignores context parameter. * * @return SessionManager instance. */ --- 175,184 ---- /** Returns instance of manager. * * Returns new instance of this class. ! * <p> * NOTE: Ignores context parameter. * + * @param context Context of instancing. * @return SessionManager instance. */ *************** *** 191,204 **** public void registerMe() { ! manager.attach(this); } /** Plugin un registration method. ! * * Unregisters this manager from the plugin manager. */ public void unRegisterMe() { ! manager.dettach(this); } } --- 194,223 ---- public void registerMe() { ! try ! { ! manager.attach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } /** Plugin un registration method. ! * * Unregisters this manager from the plugin manager. */ public void unRegisterMe() { ! try ! { ! manager.dettach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } } Index: SessionManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/plugins/SessionManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SessionManager.java 4 Sep 2005 18:57:39 -0000 1.4 --- SessionManager.java 15 Sep 2005 18:11:02 -0000 1.5 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.5 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.4 2005/09/04 18:57:39 mstsxfx * Documentation *************** *** 42,49 **** * </ul> * ! * @author msts ! * * Changes: * 22.8.2005 msts - created */ public class SessionManager extends AcceptPlugin implements ISessionManager --- 46,56 ---- * </ul> * ! * <pre> * Changes: * 22.8.2005 msts - created + * </pre> + * + * + * @author msts */ public class SessionManager extends AcceptPlugin implements ISessionManager *************** *** 57,61 **** * To get copy of this list use getActive method. * ! * @see getActive * @see SessionNode */ --- 64,68 ---- * To get copy of this list use getActive method. * ! * @see SessionManager#getActive * @see SessionNode */ *************** *** 101,109 **** /** Returns active top level sessions. - * @param id Identificator of caller. * * Returns all registerd top level sessions. * * TODO consider id and security manager. * @return Array of sessions. */ --- 108,117 ---- /** Returns active top level sessions. * * Returns all registerd top level sessions. * * TODO consider id and security manager. + * + * @param id Identificator of caller. * @return Array of sessions. */ *************** *** 118,123 **** /** Registers new toplevel session. - * @param id Caller identificator. - * @param sessionplugin Plugin for session creation. * * Creates new session from plugin factory (given as parameter) and --- 126,129 ---- *************** *** 129,132 **** --- 135,140 ---- * TODO consider id * + * @param id Caller identificator. + * @param sessionplugin Plugin for session creation. * @return Created session. */ *************** *** 155,161 **** /** Creates new child session. - * @param id Caller identificator. - * @param session Parent session. - * @param sessionplugin Plugin for session creation. * * Creates new subsession of given session. To the same as --- 163,166 ---- *************** *** 165,168 **** --- 170,176 ---- * TODO consider id * + * @param id Caller identificator. + * @param session Parent session. + * @param sessionplugin Plugin for session creation. * @return Created session. */ *************** *** 208,217 **** * @return list of all registered plugin factories. */ ! synchronized public List<ISessionFactory> getSessionFactories()//{{{ { // gets all ISessionFactory typed plugins PluginList sessions=getByIface(ISessionFactory.class); - if(sessions==null) - return null; // makes copy of the list to prevent changes --- 216,223 ---- * @return list of all registered plugin factories. */ ! synchronized public List<ISessionFactory> getSessionFactories()throws PluginException//{{{ { // gets all ISessionFactory typed plugins PluginList sessions=getByIface(ISessionFactory.class); // makes copy of the list to prevent changes *************** *** 227,232 **** /** Kills session. - * @param id Caller identificator. - * @param session Session to kill. * * Kills given session. If session's state is FINISH kills all --- 233,236 ---- *************** *** 238,241 **** --- 242,247 ---- * TODO consider id * + * @param id Caller identificator. + * @param session Session to kill. */ synchronized public void killSession(IIdentity id, ISession session)//{{{ *************** *** 315,319 **** /** Returns instance of manager. - * @param context Context of instancing. * * Returns singleton instance of the manager. --- 321,324 ---- *************** *** 321,324 **** --- 326,330 ---- * NOTE: Ignores context parameter. * + * @param context Context of instancing. * @return SessionManager instance. */ *************** *** 336,340 **** // TODO use logger LogManager.getInstance().getLogger(logName).log(ILogger.Level.INFO,"Registering "+this+" session manager to the "+manager); ! manager.attach(this); } --- 342,354 ---- // TODO use logger LogManager.getInstance().getLogger(logName).log(ILogger.Level.INFO,"Registering "+this+" session manager to the "+manager); ! try ! { ! manager.attach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } *************** *** 347,351 **** // TODO use logger LogManager.getInstance().getLogger(logName).log(ILogger.Level.INFO,"Unregistering "+this+" session manager from "+manager); ! manager.dettach(this); } --- 361,373 ---- // TODO use logger LogManager.getInstance().getLogger(logName).log(ILogger.Level.INFO,"Unregistering "+this+" session manager from "+manager); ! try ! { ! manager.dettach(this); ! }catch(Exception e) ! { ! /* Should'n happen ! * TODO: handle ! */ ! } } *************** *** 353,359 **** /** Helper kill method. - * @param root Root node for session. * * Recursively closes all children of given root session node. */ protected void killChildren(SessionNode root)//{{{ --- 375,382 ---- /** Helper kill method. * * Recursively closes all children of given root session node. + * + * @param root Root node for session. */ protected void killChildren(SessionNode root)//{{{ *************** *** 378,383 **** /** Helper method to find session node in session tree. - * @param root Root node where to start search. - * @param session Session to find. * * Returns session node from session tree for session. Search starts --- 401,404 ---- *************** *** 386,392 **** * stops either if root equals with session or all children return with * null. ! * ! * @return Session node for session. ! * @return null if no session node for session exists in session tree. */ protected SessionNode find(SessionNode root,ISession session)//{{{ --- 407,415 ---- * stops either if root equals with session or all children return with * null. ! * ! * @param root Root node where to start search. ! * @param session Session to find. ! * @return Session node for session or null if no session node for ! * session exists in session tree. */ protected SessionNode find(SessionNode root,ISession session)//{{{ *************** *** 432,441 **** /** Helper method to remove session node from session tree. - * @param parent Root node. - * @param child Session node to remove. * * Removes session node from root session node children list. If root * is null, removes session from rootSessions. * */ protected void remove(SessionNode parent,SessionNode child)//{{{ --- 455,464 ---- /** Helper method to remove session node from session tree. * * Removes session node from root session node children list. If root * is null, removes session from rootSessions. * + * @param parent Root node. + * @param child Session node to remove. */ protected void remove(SessionNode parent,SessionNode child)//{{{ |
From: Michal H. <ms...@us...> - 2005-09-15 18:11:11
|
Update of /cvsroot/exfex/exfex/source/exfex/common/pluginsystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5834/source/exfex/common/pluginsystem Modified Files: IPluginStrategy.java PluginLoadException.java IInject.java AcceptPlugin.java PluginList.java DependencyMap.java IAcceptPlugin.java PluginStrategy.java IContext.java IPluginPolicy.java PluginManager.java IPlugin.java PluginException.java Added Files: package.html Log Message: documentation corrected som code fixing Index: IAcceptPlugin.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/IAcceptPlugin.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IAcceptPlugin.java 11 Aug 2005 17:28:42 -0000 1.6 --- IAcceptPlugin.java 15 Sep 2005 18:11:02 -0000 1.7 *************** *** 6,9 **** --- 6,13 ---- * * $Log$ + * Revision 1.7 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.6 2005/08/11 17:28:42 mstsxfx * interface update *************** *** 26,45 **** package exfex.common.pluginsystem; - import java.util.List; /** Accept plugin interface. * ! * Interface for classes that may be target of Plugin ! * registerMe method. These classes may hold plugins ! * and use them for their purposes, such as distribute ! * them for others that need such plugin. Each class ! * defines logic over its plugins. ! * ! * TODO throws statments and exceptions types * - * @author msts * * Changes * 23.7.2005 msts - created */ public interface IAcceptPlugin --- 30,56 ---- package exfex.common.pluginsystem; /** Accept plugin interface. * ! * Interface for classes that may be target of Plugin registerMe method. These ! * classes are, by convention, called managers and may hold plugins and use them ! * for their purposes, such as distribute them for others that need such plugin. ! * Each manager defines logic over its plugins. ! * <p> ! * Conventions are as follows: ! * <ul> ! * <li>All managers register itself to the PluginManager. ! * <li>Plugins that aren't managers have types in general form nameFactory. Name ! * stands for concrete type name. ! * <li>Managers have names without Factory suffix. ! * </ul> * * + * <pre> * Changes * 23.7.2005 msts - created + * </pre> + * + * @author msts */ public interface IAcceptPlugin *************** *** 47,100 **** /** Attaches plugin to the class. * ! * @param plugin Plugin interface to attach. * ! * This method is called when Plugin register itself ! * to the manager. It is supposed to register plugin to ! * its internal structures to be able to search it in the ! * future. */ ! public void attach(IPlugin plugin); ! /** De attaching Plugin from class. * ! * @param plugin Plugin. * ! * This method is called during plugin clean up ! * method unRegisterMe. It is supposed to clean up ! * after attach method. */ ! public void dettach(IPlugin plugin); /** Atomicaly change oldOne plugin with the conflicting * newOne plugin. * * @param oldOne Plugin to be removed. * @param newOne Plugin to be inserted. ! * ! * Removes oldOne plugin and insert newOne instead. This method ! * shuld be done atomicaly to prevent race conditions. */ ! public void change(IPlugin oldOne, IPlugin newOne); /** Returns Plugin instance according the name. ! * @param pluginType Type of plugin. ! * @param name Name of plugin. ! * * Search for plugin by type and name. * * @return Plugin instance If found. ! * @return null Otherwise. */ ! public IPlugin getByName(Class<?> pluginType, String name); /** Returns all type compatible plugins with given one. - * @param pluginType Type of plugin. * * Returns all plugins which implements given interface. * * @return PluginList instance if at least one plugin is found. ! * @return null Otherwise. */ ! public PluginList getByIface(Class<?> pluginType); } --- 58,123 ---- /** Attaches plugin to the class. * ! * This method is called by plugin when it's ready to register itself to ! * the manager from registerMe method. ! * Manager should handle this that way that inserts plugin to internal ! * structures (primary to be able to search and so on). ! * <p> ! * Implementator can rely on fact that plugin is fully initialized in ! * time of invocation of this method. * ! * ! * @param plugin Plugin interface to attach. ! * @throws PluginException if some error occure (see exception's ! * message for more information). */ ! public void attach(IPlugin plugin)throws PluginException; ! /** De attaches Plugin from class. * ! * This method is called by plugin during plugin clean up from ! * unRegisterMe method. It is supposed to clean up after attach method. * ! * @param plugin Plugin. ! * @throws PluginException if some error occure (see exception's ! * message for more information). */ ! public void dettach(IPlugin plugin)throws PluginException; /** Atomicaly change oldOne plugin with the conflicting * newOne plugin. * + * Removes oldOne plugin and insert newOne instead. This method + * shuld be done atomicaly to prevent race conditions. This method is + * here primary for conflict plugins handling. + * * @param oldOne Plugin to be removed. * @param newOne Plugin to be inserted. ! ! * @throws PluginException if some error occure (see exception's ! * message for more information). */ ! public void change(IPlugin oldOne, IPlugin newOne)throws PluginException; /** Returns Plugin instance according the name. ! * * Search for plugin by type and name. * + * @param pluginType Type of plugin. + * @param name Name of plugin. * @return Plugin instance If found. ! * ! * @throws PluginException if no such plugin exists. */ ! public IPlugin getByName(Class<?> pluginType, String name)throws PluginException; /** Returns all type compatible plugins with given one. * * Returns all plugins which implements given interface. * + * @param pluginType Type of plugin. * @return PluginList instance if at least one plugin is found. ! * @throws PluginException if no plugin with given type is registered. */ ! public PluginList getByIface(Class<?> pluginType)throws PluginException; } Index: AcceptPlugin.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/AcceptPlugin.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AcceptPlugin.java 11 Sep 2005 21:55:40 -0000 1.10 --- AcceptPlugin.java 15 Sep 2005 18:11:02 -0000 1.11 *************** *** 1,13 **** ! /** ! * Accept plugin implementation. ! * ! * ! * @author mlhs ! * ! * $RCSfile$ * $Revision$ * * * $Log$ * Revision 1.10 2005/09/11 21:55:40 pavel_o * Added exceptions --- 1,12 ---- ! /* ! * * $RCSfile$ * $Revision$ * * * $Log$ + * Revision 1.11 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.10 2005/09/11 21:55:40 pavel_o * Added exceptions *************** *** 42,60 **** * */ - package exfex.common.pluginsystem; ! import java.util.LinkedList; ! import java.util.List; import java.util.ListIterator; import java.util.Iterator; import java.util.Map; - import java.util.Map.Entry; import java.util.HashMap; import java.util.Set; ! import exfex.common.pluginsystem.*; import java.util.concurrent.locks.ReentrantReadWriteLock; ! public class AcceptPlugin implements IAcceptPlugin { --- 41,65 ---- * */ package exfex.common.pluginsystem; ! import java.util.ListIterator; import java.util.Iterator; import java.util.Map; import java.util.HashMap; import java.util.Set; ! import java.util.concurrent.locks.ReentrantReadWriteLock; ! /** ! * Accept plugin implementation. ! * ! * ! * @author mlhs ! * ! * <pre> ! * Changes: ! * </pre> ! */ public class AcceptPlugin implements IAcceptPlugin { *************** *** 64,67 **** --- 69,74 ---- */ private Map< IPlugin, PluginList > pluginLists = null; + + /** Read-Write lock for synchronization. */ private ReentrantReadWriteLock rwl = null; *************** *** 76,81 **** } ! ! public void attach(IPlugin plugin) { rwl.writeLock().lock(); --- 83,93 ---- } ! ! /** ! * @inheritDoc ! * ! * TODO: detailed description ! */ ! public void attach(IPlugin plugin)throws PluginException { rwl.writeLock().lock(); *************** *** 118,121 **** --- 130,138 ---- } + /** + * @inheritDoc + * + * TODO: detailed description + */ public void dettach(IPlugin plugin) { *************** *** 150,153 **** --- 167,175 ---- } + /** + * @inheritDoc + * + * TODO: detailed description + */ public void change(IPlugin oldOne, IPlugin newOne) { *************** *** 177,181 **** } ! public IPlugin getByName(Class<?> pluginType, String name) { rwl.readLock().lock(); --- 199,208 ---- } ! /** ! * @inheritDoc ! * ! * TODO: detailed description ! */ ! public IPlugin getByName(Class<?> pluginType, String name)throws PluginException { rwl.readLock().lock(); *************** *** 218,223 **** } ! ! public PluginList getByIface(Class<?> pluginType) { rwl.readLock().lock(); --- 245,254 ---- } ! /** ! * @inheritDoc ! * ! * TODO: detailed description ! */ ! public PluginList getByIface(Class<?> pluginType)throws PluginException { rwl.readLock().lock(); Index: IPluginStrategy.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/IPluginStrategy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IPluginStrategy.java 13 Aug 2005 13:35:13 -0000 1.2 --- IPluginStrategy.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/13 13:35:13 mstsxfx * new types *************** *** 17,33 **** * inform about strategy. * ! * @author msts. ! * ! * * Changes: * 13.8.2005 msts - New types * 9.8.2005 msts - created */ public interface IPluginStrategy { ! /** Defined types of strategy.*/ public static enum Type{FIRST,LAST,NEWEST,NAMEMATCH}; ! /** Returnes type of the strategy. */ public Type getType(); --- 21,51 ---- * inform about strategy. * ! * <pre> * Changes: * 13.8.2005 msts - New types * 9.8.2005 msts - created + * </pre> + * + * @author msts. */ public interface IPluginStrategy { ! /** Defined types of strategy. ! * ! * Strategy types of the plugin. ! * ! * TODO: detailed description. ! * ! * @author msts ! * <pre> ! * Changes: ! * </pre> ! */ public static enum Type{FIRST,LAST,NEWEST,NAMEMATCH}; ! /** Returnes type of the strategy. ! * ! * @return Strategy type. ! */ public Type getType(); Index: PluginList.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/PluginList.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PluginList.java 4 Sep 2005 19:09:40 -0000 1.6 --- PluginList.java 15 Sep 2005 18:11:02 -0000 1.7 *************** *** 6,9 **** --- 6,13 ---- * * $Log$ + * Revision 1.7 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.6 2005/09/04 19:09:40 mstsxfx * new toList method *************** *** 23,27 **** import java.util.*; - import exfex.common.pluginsystem.*; /** Class to store list of plugins. --- 27,30 ---- *************** *** 41,49 **** * with the listIterator method. * - * @author msts * * Changes: * 14.8.2005 msts - all public methods are synchronized * 9.8.2005 msts - created */ public class PluginList --- 44,55 ---- * with the listIterator method. * * + * <pre> * Changes: * 14.8.2005 msts - all public methods are synchronized * 9.8.2005 msts - created + * </pre> + * + * @author msts */ public class PluginList *************** *** 63,73 **** /** Insert plugin to the list. - * @param plugin Plugin to insert. * * Inserts plugin to the end of list. If such plugin already exists * in the list, it'll not insert it (uses searchExact). * ! * @return true If succesfully inserted to the list. ! * @return false Otherwise. */ synchronized public boolean addPlugin(IPlugin plugin)//{{{ --- 69,78 ---- /** Insert plugin to the list. * * Inserts plugin to the end of list. If such plugin already exists * in the list, it'll not insert it (uses searchExact). * ! * @param plugin Plugin to insert. ! * @return true If succesfully inserted to the list, otherwise false. */ synchronized public boolean addPlugin(IPlugin plugin)//{{{ *************** *** 82,92 **** /** Removes plugin from the list. - * @param plugin Plugin to remove. * * Search plugin (using getIndex) and if found removes it from the * list. * ! * @return true If plugin was removed. ! * @return false Otherwise. */ synchronized public boolean removePlugin(IPlugin plugin)//{{{ --- 87,96 ---- /** Removes plugin from the list. * * Search plugin (using getIndex) and if found removes it from the * list. * ! * @param plugin Plugin to remove. ! * @return true If plugin was removed, otherwise false. */ synchronized public boolean removePlugin(IPlugin plugin)//{{{ *************** *** 102,107 **** /** Chages one implementator for other. - * @param original Original plugin in list. - * @param replace Plugin to replace original. * * Replaces original plugin in list for replace. Plugins must --- 106,109 ---- *************** *** 109,114 **** * implementators). * ! * @return true if chage has been successfull. ! * @return false Otherwise. */ synchronized public boolean changePlugin(IPlugin original, IPlugin replace)//{{{ --- 111,117 ---- * implementators). * ! * @param original Original plugin in list. ! * @param replace Plugin to replace original. ! * @return true if chage has been successfull, otherwise false. */ synchronized public boolean changePlugin(IPlugin original, IPlugin replace)//{{{ *************** *** 134,138 **** }//}}} ! /** Removes and returns first plugin from list. */ synchronized public IPlugin pollPlugin()//{{{ { --- 137,143 ---- }//}}} ! /** Removes and returns first plugin from list. ! * @return Plugin instance. ! */ synchronized public IPlugin pollPlugin()//{{{ { *************** *** 141,145 **** }//}}} ! /** Returns list and create new one (empty). */ synchronized public List<IPlugin> clearPlugins()//{{{ { --- 146,153 ---- }//}}} ! /** Returns list and creates new one (empty). ! * ! * @return Copy of insternal plugin list. ! */ synchronized public List<IPlugin> clearPlugins()//{{{ { *************** *** 158,161 **** --- 166,173 ---- } + /** Creates and returns iterator on list. + * + * @return ListIterator to traverse all plugins. + */ synchronized public ListIterator<IPlugin> listIterator() { *************** *** 164,176 **** /** Search for compatibles plugins in list. - * @param plugin Plugin type. * * Search for compatible plugins from list (using isCompatble static * method). * ! * @return list of compatibles plugins. ! * @return null if no compatible found. */ ! synchronized public List<IPlugin> searchType(Class<?> plugin)//{{{ { // Null plugin is ignored --- 176,187 ---- /** Search for compatibles plugins in list. * * Search for compatible plugins from list (using isCompatble static * method). * ! * @param plugin Plugin type. ! * @return list of compatibles plugins or null if no compatible found. */ ! synchronized public List<IPlugin> searchType(Class<? extends IPlugin> plugin)//{{{ { // Null plugin is ignored *************** *** 192,202 **** }//}}} ! /** Search plugin with consideration to the name. ! * @param plugin Plugin to search. * * Search plugin by type and name (using getIndex). * ! * @return Plugin compatible with given one and with same names. ! * @return null If not found. */ synchronized public IPlugin searchExact(IPlugin plugin)//{{{ --- 203,213 ---- }//}}} ! /** Searches plugin with consideration to the name. * * Search plugin by type and name (using getIndex). * ! * @param plugin Plugin to search. ! * @return Plugin compatible with given one and with same names, or null ! * If not found. */ synchronized public IPlugin searchExact(IPlugin plugin)//{{{ *************** *** 213,217 **** /** Makes copy of the list and returns as List object. * ! * Creates new list (LinkedList) and returns it as List. */ synchronized public List<IPlugin> toList() --- 224,231 ---- /** Makes copy of the list and returns as List object. * ! * Creates new list (LinkedList), copies all plugins from internal list ! * and returns it as List. ! * ! * @return List of all plugins. */ synchronized public List<IPlugin> toList() *************** *** 221,231 **** /** Returns index of plugin in list. - * @param plugin Plugin to search. * * Search plugin in the list and returnes it's index. * Plugins are considered if they have same name and are compatible. * ! * @return Index (0 is first and list.size()-1 is last) in the list. ! * @return -1 If not found. */ protected int getIndex(IPlugin plugin)//{{{ --- 235,245 ---- /** Returns index of plugin in list. * * Search plugin in the list and returnes it's index. * Plugins are considered if they have same name and are compatible. * ! * @param plugin Plugin to search. ! * @return Index (0 is first and list.size()-1 is last) in the list or ! * -1 If not found. */ protected int getIndex(IPlugin plugin)//{{{ *************** *** 251,272 **** }//}}} ! /** Finds out if given plugins are type compatible. ! * @param plg1 Plugin type. ! * @param plg2 Plugin. * ! * This mthod should be used if we want to find out if type of plg2 ! * is compatible with plg1 type. ! * <br> * example:<br> * PluginList.isCompatible(IPlugin.class, someplugin)<br> * will return true iff someplugin implements IPlugin interface and so * can be used as plugin. ! * <br> * If you want to compare to plugins for compatibility, use method with * same name but diferent parameters isCompatible(IPlugin,IPlugin) * instead. * ! * @return true If plg1 is compatible with plg2. ! * @return false Otherwise. */ static public boolean isCompatible(Class<?> plg1, IPlugin plg2)//{{{ --- 265,286 ---- }//}}} ! /** Finds out if given plugins is type compatible with given plugin ! * type. * ! * This mthod should be used if we want to find out if instance plg2 ! * is type compatible with plg1. ! * <p> * example:<br> * PluginList.isCompatible(IPlugin.class, someplugin)<br> * will return true iff someplugin implements IPlugin interface and so * can be used as plugin. ! * <p> * If you want to compare to plugins for compatibility, use method with * same name but diferent parameters isCompatible(IPlugin,IPlugin) * instead. * ! * @param plg1 Plugin type. ! * @param plg2 Plugin. ! * @return true If plg1 is compatible with plg2, otherwise fals. */ static public boolean isCompatible(Class<?> plg1, IPlugin plg2)//{{{ *************** *** 282,287 **** /** Tests if plg2 is interface compatible with plg1. - * @param plg1 Plugin. - * @param plg2 Plugin to find out compatibility. * * Compares if plg2 can stand for plg1. It will return true --- 296,299 ---- *************** *** 290,295 **** * NOTE: It doesn't have to be reflexive relation. * ! * @param true if plg2 is compatible with plg1 ! * @param false Otherwise. */ static public boolean isCompatible(IPlugin plg1, IPlugin plg2)//{{{ --- 302,308 ---- * NOTE: It doesn't have to be reflexive relation. * ! * @param plg1 Plugin. ! * @param plg2 Plugin to find out compatibility. ! * @return true if plg2 is compatible with plg1, otherwise false. */ static public boolean isCompatible(IPlugin plg1, IPlugin plg2)//{{{ Index: IPlugin.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/IPlugin.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IPlugin.java 14 Aug 2005 12:18:53 -0000 1.5 --- IPlugin.java 15 Sep 2005 18:11:02 -0000 1.6 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.6 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.5 2005/08/14 12:18:53 mstsxfx * getInstance changed *************** *** 12,36 **** package exfex.common.pluginsystem; - import exfex.common.pluginsystem.*; ! /** Basic plugin interface. * ! * This interface is common for all plugins. ! * <br> * <b>Plugin writing rules</b>: * <br> * Each plugin have to implement this interface otherwise it will be ! * rejected during loading. This interface contains all necessery * stuff for plugin registration - registerMe and unRegisterMe methods; * identifying - getName method and instancing - getInstance method. * <br> ! * <i>Registration</i>: ! * <br> ! * Put all necessery stuff in registerMe method. At least you should ! * attach your plugin to exactly one manager (class that implements ! * IAcceptPlugin interface). If your plugin is manager it self it ! * should be registered in PluginManager which can be accesed by static ! * method PluginManager.getInstance(). If you want to register on other ! * manager, there are 2 ways how to get its instance: * <ul> * <li> --- 16,41 ---- package exfex.common.pluginsystem; ! /** Basic low level plugin interface. * ! * This interface is common for all plugins and all instances of this type ! * are considered to be plugins. ! * <p> * <b>Plugin writing rules</b>: * <br> * Each plugin have to implement this interface otherwise it will be ! * rejected during loading process. This interface contains all necessery * stuff for plugin registration - registerMe and unRegisterMe methods; * identifying - getName method and instancing - getInstance method. + * <p> + * <b>Registration</b>: * <br> ! * Put all necessery stuff in registerMe method. At least you should attach your ! * plugin to exactly one manager (class that implements IAcceptPlugin interface). ! * However this step can be done when plugin is ready to work, so all other ! * intialization is done yet. After attach, plugin can be immediately used. ! * If your plugin is manager it self it should be registered in PluginManager ! * which can be accesed by static method PluginManager.getInstance(). If you ! * want to register on other manager, there are 2 ways how to get its instance: * <ul> * <li> *************** *** 44,79 **** * annotated field of your plugin class. This way is cleaner and safer, becase * you can be sure, that such manager already exists (dependencies are solved). ! * @see IInject * </ul> ! * When you have your manager call manager.attach(this) method and you will * be registered. * * <br> - * <i>Instancing</i> * Plugin itself is intended to be just factory class. You have to implement ! * getInstance method to choose your instancing policy. * * <br> - * <i>Identity</i> * Each plugin is unique by its type and name. If there are more plugins with * the same type, they are considered to be diferent implementators of the * same task (these plugins are compatible). There are not allowed two * compatible plugins with the same name (these are called conflict plugins). * ! * @author msts ! * * TODO shouldn't getInstance return Object instead of IPlugin? ! * * Cahnges: * 14.8.2005 msts - getInstance changed * 13.8.2005 msts - documentation * 23.7.2005 msts - created (partly documented) */ public interface IPlugin { ! /** Specific name of Plugin. * ! * This can be used as plugin identificator among ! * other plugins with the same interface (type). * * @return The name of plugin. --- 49,100 ---- * annotated field of your plugin class. This way is cleaner and safer, becase * you can be sure, that such manager already exists (dependencies are solved). ! * * </ul> ! * When you have your manager, call manager.attach(this) method and you will * be registered. * + * <p> + * <b>Instancing</b>: * <br> * Plugin itself is intended to be just factory class. You have to implement ! * getInstance method to choose your instancing policy. Product of this method ! * is plugin maintained object (not plugin itself). Result should be used by ! * higher level plugin API that should safely cast to final product type. ! * Clients should avoid direct using of this method. ! * Higher level API is defined as interface and is aimed for special task. ! * <br> ! * getInstance method also defines instancing policy what means that constrols ! * how to create instances - e.g. Manager should keep singleton pattern and ! * specialized Factories should allways create new instance. * + * <p> + * <b>Identity</b>: * <br> * Each plugin is unique by its type and name. If there are more plugins with * the same type, they are considered to be diferent implementators of the * same task (these plugins are compatible). There are not allowed two * compatible plugins with the same name (these are called conflict plugins). + * Note that plugins are compared according implemented interfaces. * ! * <pre> * TODO shouldn't getInstance return Object instead of IPlugin? ! * * Cahnges: * 14.8.2005 msts - getInstance changed * 13.8.2005 msts - documentation * 23.7.2005 msts - created (partly documented) + * </pre> + * + * @see exfex.common.pluginsystem.PluginList#isCompatible(IPlugin, IPlugin) + * @see exfex.common.pluginsystem.IAcceptPlugin + * @see exfex.common.pluginsystem.IInject + * @author msts */ public interface IPlugin { ! /** Returns specific name of the Plugin. * ! * This can be used as plugin identificator among other plugins with the ! * same interface (type), according PluginList.isCompatible method. * * @return The name of plugin. *************** *** 81,87 **** public String getName(); ! /** Return instance of plugin. ! * @param context Context for method. ! * * All plugins are expected to be factory classes that produces some * objects. This is basic form how to get object from this factory. --- 102,107 ---- public String getName(); ! /** Returns instance of plugin's maintained object. ! * * All plugins are expected to be factory classes that produces some * objects. This is basic form how to get object from this factory. *************** *** 89,96 **** * way to get instances (such specialized methods with certain return * type), but they will use this low-level method for instancing. ! * To control processing of method, you ca put context to the * parameter. ! * @see IContext * * @return Instance of Plugin object. */ --- 109,123 ---- * way to get instances (such specialized methods with certain return * type), but they will use this low-level method for instancing. ! * To control processing of method, you can put context to the * parameter. ! * <p> ! * Higher level of plugin is defined as interface, e.g. IButtonFactory ! * which extends this interface and adds method IButton getButton(). ! * This method uses getInstance to get instance and follows with more ! * complex setting. ! * ! * @see exfex.common.pluginsystem.IContext * + * @param context Context for method. * @return Instance of Plugin object. */ *************** *** 99,106 **** /** Registration method. * ! * Registers itself to manager and makes stuff to be ! * prepared to work. ! * All this has to be cleand up by @link unRegisterMe ! * method. */ public void registerMe(); --- 126,142 ---- /** Registration method. * ! * Method should perform all plugin specific intialization work. ! * This involves: ! * <ul> ! * <li>configuration tasks (e.g. creating SettingBuilder for ! * SettingManager and registrating all configuration settings) ! * <li>creating objects needed to work properly. ! * <li>attaching to a manager. ! * </ul> ! * Registration process is in hand of plugin, but implementator of the ! * plugin should keep in mind, that after plugin has attached to manager ! * it can be immediately used, so it should be completly ready. ! * ! * @see exfex.common.pluginsystem.IAcceptPlugin */ public void registerMe(); *************** *** 108,113 **** /** Deregistration method. * ! * Clean up method. It has to deatach from manager. ! * It's called when modul is purged from system. */ public void unRegisterMe(); --- 144,150 ---- /** Deregistration method. * ! * Clean up method. It has to deatach from manager in first step. ! * It's called when modul is purged from system. This method should be ! * kind of inversion of registerMe method. */ public void unRegisterMe(); *************** *** 117,121 **** * Each plugin registers itself to exact one manager when it's * loaded. This is done in registerMe method. ! * <br> * Manager that can accept plugin must implement IAcceptPlugin * interface, so we return this type as Manager. --- 154,158 ---- * Each plugin registers itself to exact one manager when it's * loaded. This is done in registerMe method. ! * <p> * Manager that can accept plugin must implement IAcceptPlugin * interface, so we return this type as Manager. Index: PluginException.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/PluginException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PluginException.java 10 Aug 2005 19:30:32 -0000 1.1 --- PluginException.java 15 Sep 2005 18:11:02 -0000 1.2 *************** *** 10,13 **** --- 10,21 ---- public class PluginException extends Exception { + /** + * Field for serialization purposes. + */ + static final long serialVersionUID=1L; + + /** Constructor with exception description. + * @param message Context of the exception. + */ public PluginException(String message) { --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> </head> <body bgcolor="white"> <h2>Package Specification</h2> <h2>Related Documentation</h2> </body> </html> Index: PluginLoadException.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/PluginLoadException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PluginLoadException.java 10 Aug 2005 19:33:56 -0000 1.2 --- PluginLoadException.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 1,7 **** package exfex.common.pluginsystem; ! /** Plugin load error exception. */ public class PluginLoadException extends PluginException { public PluginLoadException(String message) { --- 1,23 ---- package exfex.common.pluginsystem; ! /** Plugin load error exception. ! * ! * ! * <pre> ! * Changes: ! * </pre> ! * ! * @author msts ! */ public class PluginLoadException extends PluginException { + /** + * Field for serialization purposes. + */ + static final long serialVersionUID=1L; + + /** Constructor with exception description. + * @param message Context of the exception. + */ public PluginLoadException(String message) { Index: IPluginPolicy.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/IPluginPolicy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IPluginPolicy.java 13 Aug 2005 14:05:24 -0000 1.2 --- IPluginPolicy.java 15 Sep 2005 18:11:02 -0000 1.3 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.3 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.2 2005/08/13 14:05:24 mstsxfx * documentation, version field *************** *** 13,34 **** import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - import exfex.common.pluginsystem.*; ! /** Annotation for Plugin information. * * This runtime annotation is used to set Plugin policy. ! * <br> * Fields: * <ul> ! * <li>strategy - Strategy for case when conflicting plugin occures. * <li>version - Version of plugin (arbitrary number value - higher number * means newer version). * </ul> * ! * @author msts ! * * Changes: * 13.10.2005 msts - version field and documentation add * 8.10.2005 msts - created */ @Retention(RetentionPolicy.RUNTIME) --- 17,55 ---- import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; ! ! /** Annotation for Plugin policy information. * * This runtime annotation is used to set Plugin policy. ! * Plugin policy represents meta information needed to maintain plugins by ! * plugin manager. ! * <p> ! * Example of use is when conflicting situation's occured (Reguest for plugin ! * load, but plugin with the same type and name is already in the system. This ! * situation may be conflict - because new plugin can completly change behaviour ! * and so depedendencies may be broken - or it can be update when newer and ! * better plugin should replace old one.). In such situation plugin policy of ! * old (registerd in the system) one is considered to solve the situation. ! * <p> ! * NOTE: ! * Plugins that are not annotated are automaticaly treated like have one with ! * LAST strategy. ! * <p> * Fields: * <ul> ! * <li>strategy - Strategy of selection. This field is primary information. * <li>version - Version of plugin (arbitrary number value - higher number * means newer version). * </ul> * ! * ! * <pre> * Changes: * 13.10.2005 msts - version field and documentation add * 8.10.2005 msts - created + * </pre> + * + * @see exfex.common.pluginsystem.IPluginStrategy + * @author msts */ @Retention(RetentionPolicy.RUNTIME) *************** *** 48,51 **** --- 69,73 ---- * version number. * <li>NAMEMATCH - doesn't make ANY SENSE to use this strategy. + * <li>TODO ATLEAST * </ul> */ Index: PluginManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/PluginManager.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PluginManager.java 4 Sep 2005 19:11:17 -0000 1.11 --- PluginManager.java 15 Sep 2005 18:11:02 -0000 1.12 *************** *** 6,9 **** --- 6,13 ---- * * $Log$ + * Revision 1.12 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.11 2005/09/04 19:11:17 mstsxfx * strategySelect declaration changed *************** *** 55,96 **** * <li><b>load plugin</b> - load class file that contains plugin (class that * implemnts IPlugin interface). Solve all dependencies (fields of plugin ! * annoteted by IInject), e.g. loads all plugins on which is plugin depended. ! * If manager can't satisfy all dependencies of plugin, store it to later * attemp (new module load) until all dependencies can be solved. This means * that load method calling doesn't imply creation and registration of the * plugin. It will garantee that plugin will be registered as soon as possible. - * @see load. * <li><b>store all loaded plugins</b> - keep information about all loaded * plugins. This information is used when we want to purge plugin or find out ! * which plugins are load. This class stores 3 list of plugins: <u>depList</u> ! * which stores all plugins with unresolved (scheduled) dependencies (each time ! * when new plugin is load, it will be inserted to this list and then all ! * members from list are tried to solve their dependencies). ! * <u>resolvingList</u> which contains all plugins that are in proccess of ! * solving their dependencies (When probing plugins from depList, they are ! * removed form depList to the resolvingList). ! * Finaly <u>readyList</u> is list that contains all plugins with dependencies ! * solved and which are registered, so they can be safely used by clients. ! * @see solveDependencies ! * @see IPlugin.registerMe ! * * <li><b>purge plugin</b> - get rid of plugin from readyList and unregisters * plugin from system. This can triger recursive purging of all depended * plugins. ! * @see purge ! * @see IPlugin.unRegisterMe * </ul> ! * <br> * <b>Usage</b>: * This Class is intended to be singleton, so there is no public constructor and * instance of the class can be obtained by static getInstance method. ! * To manage plugins use load and purge methods. If you need to choose one plugin ! * from pugin list, use static strategySelect method. ! * @see getInstance ! * @see load ! * @see purge ! * @see strategySelect ! * ! * <br> * This class extends AcceptPlugin which means that: * <ul> --- 59,95 ---- * <li><b>load plugin</b> - load class file that contains plugin (class that * implemnts IPlugin interface). Solve all dependencies (fields of plugin ! * annoteted by IInject), which means loading all plugins on which is plugin ! * depended. ! * If manager can't satisfy all dependencies of plugin, stores it to later * attemp (new module load) until all dependencies can be solved. This means * that load method calling doesn't imply creation and registration of the * plugin. It will garantee that plugin will be registered as soon as possible. * <li><b>store all loaded plugins</b> - keep information about all loaded * plugins. This information is used when we want to purge plugin or find out ! * which plugins are load. This class stores 3 list of plugins: ! * <ul> ! * <li><u>depList</u> which stores all plugins with unresolved (scheduled) ! * dependencies (each time when new plugin is load, it will be inserted to ! * this list and then all members from list are tried to solve their ! * dependencies). ! * <li><u>resolvingList</u> which contains all plugins that are in proccess ! * of solving their dependencies (When probing plugins from depList, they ! * are removed form depList to the resolvingList). ! * <li><u>readyList</u> is list that contains all plugins with dependencies ! * solved and which are registered, so they can be safely used by clients. ! * </ul> * <li><b>purge plugin</b> - get rid of plugin from readyList and unregisters * plugin from system. This can triger recursive purging of all depended * plugins. ! * * </ul> ! * <p> * <b>Usage</b>: * This Class is intended to be singleton, so there is no public constructor and * instance of the class can be obtained by static getInstance method. ! * To manage plugins use load and purge methods. If you need to choose one ! * plugin from pugin list with respect to the strategy, use static ! * strategySelect method. ! * <p> * This class extends AcceptPlugin which means that: * <ul> *************** *** 98,110 **** * <li>can store plugins and return them by type and name * </ul> ! * @see AcceptPlugin ! * <br> * NOTE: This class has all public methods synchronized, so it can be used in * multi thread environment. * * TODO use settings manager - loadFromSetting method * - * @author msts - * * Changes: * 14.8.2005 msts - Public methods synchronized --- 97,109 ---- * <li>can store plugins and return them by type and name * </ul> ! * <p> * NOTE: This class has all public methods synchronized, so it can be used in * multi thread environment. * + * + * <pre> + * * TODO use settings manager - loadFromSetting method * * Changes: * 14.8.2005 msts - Public methods synchronized *************** *** 115,118 **** --- 114,121 ---- * 25.7.2005 mlhs - IAcceptPlugin iface implementation * 23.7.2005 msts - created + * </pre> + * + * @see exfex.common.pluginsystem.AcceptPlugin + * @author msts */ public class PluginManager extends AcceptPlugin *************** *** 121,134 **** * * Instance of this class to ensure that there is just one ! * PluginManager in the system. This field is set in ! * {@link getInstance} method. */ private static PluginManager instance = new PluginManager(); /** List of ready to use plugins. ! * All loaded plugins with solved dependencies are ready to ! * be used and so they are stored in this list. ! * When new pluigin is loaded, this list is searched for ! * conflicting plugin (ready and with the same type and name). */ private PluginList readyList=null; --- 124,136 ---- * * Instance of this class to ensure that there is just one ! * PluginManager in the system. This field is set in getInstance method. */ private static PluginManager instance = new PluginManager(); /** List of ready to use plugins. ! * All load plugins with solved dependencies are ready to be used and so ! * they are stored in this list. When new pluigin is loaded, this list ! * is searched for conflicting plugin (ready and with the same type and ! * name). */ private PluginList readyList=null; *************** *** 136,140 **** /** List of plugins that needs to solve their dependencies. * ! * Unresolved dependencies list. */ private PluginList depList=null; --- 138,143 ---- /** List of plugins that needs to solve their dependencies. * ! * Unresolved dependencies list. This list is considered when new plugin ! * si load. */ private PluginList depList=null; *************** *** 177,183 **** /** Factory method for this class. * - * Creates PluginManager instance and returns it. If - * there is instace already, just returns it. - * * @return Instance of PluginManager. */ --- 180,183 ---- *************** *** 187,199 **** } ! /** Loades Plugin from class file. ! * ! * @param fileName Class file name. * * Schedule plugin to load. Plugin must be in the directory specified in * CLASSPATH. Address from CLASSPATH must use dot notation without * .class extension. Otherwise jre won't be able to find class file. ! * <br> ! * <b>Process of loading the plugin:</b><br> * <ul> * <li> --- 187,197 ---- } ! /** Loads Plugin from class file. * * Schedule plugin to load. Plugin must be in the directory specified in * CLASSPATH. Address from CLASSPATH must use dot notation without * .class extension. Otherwise jre won't be able to find class file. ! * <p> ! * <b>Process of loading the plugin:</b> * <ul> * <li> *************** *** 201,209 **** * and creates new instance. If creted instance can be cast to IPlugin * type, we can go ahead, otherwise PluginLoadException is raised. * <li> * Do preprocess to get rid of all plugins from depList that can't solve ! * their dependencies (there is no implementator for at least one class ! * field in depList or readyList). Those are removed from depList ! * to pending list. * <li> * Process all plugins from depList and try to solve its dependencies: --- 199,208 ---- * and creates new instance. If creted instance can be cast to IPlugin * type, we can go ahead, otherwise PluginLoadException is raised. + * TODO checksum consideration * <li> * Do preprocess to get rid of all plugins from depList that can't solve ! * their dependencies (there is no implementator for at least one ! * class's field in depList or readyList). Those are removed from ! * depList to pending list. * <li> * Process all plugins from depList and try to solve its dependencies: *************** *** 218,225 **** * </ul> * * @throws PluginLoadException If plugin instance is not IPlugin * compatible type (doesn't implement IPlugin interface). * ! * @see solveDependencies * */ --- 217,225 ---- * </ul> * + * @param plugin Class file name. * @throws PluginLoadException If plugin instance is not IPlugin * compatible type (doesn't implement IPlugin interface). * ! * @see PluginManager#solveDependencies * */ *************** *** 278,285 **** /** Get plugin out of the system. * - * @param plugin Plugin to remove. - * * Unregister plugin from system. ! * <br> * <b>Process of purging the plugin</b>: * <br> --- 278,283 ---- /** Get plugin out of the system. * * Unregister plugin from system. ! * <p> * <b>Process of purging the plugin</b>: * <br> *************** *** 294,297 **** --- 292,296 ---- * using DependencyMap.releaseSource. If method returns not null, * it will recursively call purge to all plugins in list. + * * </ul> * <li>Plugin is in dependency list *************** *** 302,305 **** --- 301,305 ---- * </ul> * + * @param plugin Plugin to remove. * @throws PluginException If plugin error occures (see getMessage for * more info) *************** *** 335,344 **** /** Selects one plugin from list according strategy. * @param strategy Strategy object. * @param data Additional data string. * @param list List of plugings. - * - * Choose one plugin from list according strategy. - * * @return plugin. */ --- 335,344 ---- /** Selects one plugin from list according strategy. + * + * Choose one plugin from list according strategy. + * * @param strategy Strategy object. * @param data Additional data string. * @param list List of plugings. * @return plugin. */ *************** *** 369,383 **** /** Helper method to remove plugin that is ready. - * @param plugin Ready plugin. * * Removes plugin from ready list and all its dependencies if needed * (if plugin was last implementator). ! * <br> * At first removes plugin from readyList, then calls unRegisterMe ! * method on plugin. Then removes plugin as depeded from dependency * map and finaly removes from dependency map as source of dependency. * If plugin was last implementator of the dependency source, it will * purge all depended plugins (they are already ready, so uses this * method recursively) */ private void purgeReady(IPlugin plugin)//{{{ --- 369,384 ---- /** Helper method to remove plugin that is ready. * * Removes plugin from ready list and all its dependencies if needed * (if plugin was last implementator). ! * <p> * At first removes plugin from readyList, then calls unRegisterMe ! * method on plugin. Then removes plugin (as depeded) from dependency * map and finaly removes from dependency map as source of dependency. * If plugin was last implementator of the dependency source, it will * purge all depended plugins (they are already ready, so uses this * method recursively) + * + * @param plugin Ready plugin. */ private void purgeReady(IPlugin plugin)//{{{ *************** *** 413,417 **** /** Preprocess plugins from list. - * @param plugs Plugin list to preprocess. * * Removes plugins that have no change to load on first glance. --- 414,417 ---- *************** *** 421,424 **** --- 421,425 ---- * by this method and removes them form plugs. * + * @param plugs Plugin list to preprocess. * @return List of plugins, that was removed from plugs. */ *************** *** 458,467 **** /** Search for conflict plugin. ! * @param plugin Plugin type to search. * * Search plugin in ready list (list that contains all initialized * plugins). Method is successfull iff there is plugin with the same * type and name in the list (using PluginList.searchExact). ! * <br> * NOTE: This method returns conflicting plugin to the given one, * because they can't be recognized when needed (we want to keep --- 459,468 ---- /** Search for conflict plugin. ! * * * Search plugin in ready list (list that contains all initialized * plugins). Method is successfull iff there is plugin with the same * type and name in the list (using PluginList.searchExact). ! * <p> * NOTE: This method returns conflicting plugin to the given one, * because they can't be recognized when needed (we want to keep *************** *** 470,475 **** * with diferent names). * ! * @return plugin with the same type and name. ! * @return null if there is no such plugin ready. */ private IPlugin searchConflict(IPlugin plugin)//{{{ --- 471,477 ---- * with diferent names). * ! * @param plugin Plugin type to search. ! * @return plugin with the same type and name or null if there is no ! * such plugin ready. */ private IPlugin searchConflict(IPlugin plugin)//{{{ *************** *** 479,489 **** /** Fetches plugin from name. - * @param name Name of plugin. * * Gets instance of plugin from name. Uses forName method from * the Class class. * * @return Instance of the plugin. - * * @throws PluginLoadException If some error occures during fetching * or initializing of the class (use getMessage for reason). --- 481,490 ---- /** Fetches plugin from name. * * Gets instance of plugin from name. Uses forName method from * the Class class. * + * @param name Name of plugin. * @return Instance of the plugin. * @throws PluginLoadException If some error occures during fetching * or initializing of the class (use getMessage for reason). *************** *** 512,533 **** }//}}} ! /** Solve conflict according policy. ! * @param oldone Plugin that is registered. ! * @param newone Plugin that wants to replace oldone. * * Decides whether to keep oldone version of plugin or replace it * with newone. Consults oldone's policy annotation to find out * strategy and needed stuff to decide. ! * <br> * If oldone has no policy annotation, result will be positve for * newone plugin. This is mainly because old plugins may not have ! * this annotation defined and so new plugins won't have chace to * get to system in runtime (only when starting). ! * <br> * <b>Strategies</b>: * <ul> * <li>FIRST - allways keep an old version. * </ul> * * @return Selected plugin. */ --- 513,537 ---- }//}}} ! /** Solves conflict according policy. * * Decides whether to keep oldone version of plugin or replace it * with newone. Consults oldone's policy annotation to find out * strategy and needed stuff to decide. ! * <p> * If oldone has no policy annotation, result will be positve for * newone plugin. This is mainly because old plugins may not have ! * this annotation defined and so new plugins won't have chance to * get to system in runtime (only when starting). ! * <p> * <b>Strategies</b>: * <ul> * <li>FIRST - allways keep an old version. + * <li>TODO: LAST - allways use newone. + * <li>TODO: NEWEST + * <li> * </ul> * + * @param oldone Plugin that is registered. + * @param newone Plugin that wants to replace oldone. * @return Selected plugin. */ *************** *** 556,565 **** /** Solve dependencies of plugin. - * @param plugin Plugin to solve dependencies. * * We try to solve all dependencies of given plugin. We go throught ! * all fields of the plugin and those which are annotated with ! * IInject interface are considered to be source of dependency. ! * <br> * <ul> * <li> --- 560,570 ---- /** Solve dependencies of plugin. * * We try to solve all dependencies of given plugin. We go throught ! * all fields (using relfexion API) of the plugin and those which are ! * annotated with IInject interface are considered to be source of ! * dependency. ! * <p> ! * <b>Solving process</b>: * <ul> * <li> *************** *** 577,588 **** * (field has IInject annotation). * When searching dependencies, starts to search readyList, where ! * are all regulary loaded and registered (ready to use) plugins. * If no implementator found, look in resolvingList for candidate to ! * use. If found, it means that cycle dependencies occured. * If not found in resolvingList, try to search depList. If no plugin * found, depedndency can't be resolved and returns false. Otherwise ! * recursively call this method on found plugin. If recursion returns ! * with success, inject it to the field and follows with next field. ! * If recursion returns with fail, it will fail too. * <li> * If all dependencies are solved for plugin, we will: --- 582,593 ---- * (field has IInject annotation). * When searching dependencies, starts to search readyList, where ! * are all regulary load and registered (ready to use) plugins. * If no implementator found, look in resolvingList for candidate to ! * use (If found, it means that cycle dependencies occured). * If not found in resolvingList, try to search depList. If no plugin * found, depedndency can't be resolved and returns false. Otherwise ! * recursively call this method on found dependencie (except read ones). ! * If recursion returns with success, inject it to the field and follows ! * with next field. If recursion returns with fail, it will fail too. * <li> * If all dependencies are solved for plugin, we will: *************** *** 595,598 **** --- 600,604 ---- * </ul> * + * @param plugin Plugin to solve dependencies. */ private boolean solveDependencies(IPlugin plugin)//{{{ *************** *** 631,635 **** LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"PluginManager.load replacing "+plugin+" -> "+conflict); // TODO what if conflict and plugin have ! // different dependencies // NOTE: Replacement must extend original's // dependencies !!! --- 637,642 ---- LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"PluginManager.load replacing "+plugin+" -> "+conflict); // TODO what if conflict and plugin have ! // different dependencies - consolidateDeps ! // should be called // NOTE: Replacement must extend original's // dependencies !!! *************** *** 637,641 **** IAcceptPlugin manager=conflict.getManager(); if(manager!=null) ! manager.change(conflict,plugin); return true; } --- 644,659 ---- IAcceptPlugin manager=conflict.getManager(); if(manager!=null) ! { ! try ! { ! manager.change(conflict,plugin); ! }catch(Exception e) ! { ! /*Should never happen ! TODO handle ! */ ! LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.PANIC,"Unable to replace "+plugin+" -> "+conflict); ! } ! } return true; } Index: DependencyMap.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/DependencyMap.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DependencyMap.java 17 Aug 2005 11:43:42 -0000 1.8 --- DependencyMap.java 15 Sep 2005 18:11:02 -0000 1.9 *************** *** 3,6 **** --- 3,10 ---- * * $Log$ + * Revision 1.9 2005/09/15 18:11:02 mstsxfx + * documentation corrected + * som code fixing + * * Revision 1.8 2005/08/17 11:43:42 mstsxfx * print replaced with LogManager logging *************** *** 16,46 **** import java.util.*; - import exfex.common.pluginsystem.*; import exfex.common.logging.*; ! /** Class to source of dependency. * ! * When class is needed by another class it become source of dependency. ! * This class holds plugin and counter of plugins which implements ! * the same interface. It's the key in DependencyMap class. ! * <br> * <b>Usage</b>:<br> ! * New instance of this class is created when new source of dependency ! * occures (no compatible plugin is source of dependency). ! * Method put should be called when there is compatible plugin ! * already. * When purging some plugin and it's also source of dependency, method * release have to be called. When this method returns true, all dependent ! * plugins (can be found in DependencyMap) have to be purged too. ! * <br> * NOTE: Class is not synchronized, so it can be used only from synchronized * environment. * ! * @author msts ! * * TODO use loggmanager * * Changes: * 6.8.2005 msts - created */ class DependencySource --- 20,56 ---- import java.util.*; import exfex.common.logging.*; ! /** Source of dependency class. * ! * This class holds information about plugin dependency source. This involves ! * Plugin type (more precisly source of dependency type) and all implementators ! * of this source. This architecture enables to keep dependency relation where ! * many implementators of one plugin type are source of dependency. ! * Instance of this class is typicaly the key in DependencyMap class. ! * <p> * <b>Usage</b>:<br> ! * User shouldn't create instance of this class directly. It's created when ! * needed by DependencyMap class. New instance is created when new source of ! * dependency occures (no compatible plugin is source of dependency). ! * If already exists dependency source with compatible type with new source ! * of dependency relation, method put have to be called. * When purging some plugin and it's also source of dependency, method * release have to be called. When this method returns true, all dependent ! * plugins (can be found in DependencyMap) should be considered for purging, ! * because it was last implementator of this type and. ! * <p> * NOTE: Class is not synchronized, so it can be used only from synchronized * environment. * ! * <pre> ! * * TODO use loggmanager * * Changes: * 6.8.2005 msts - created + * </pre> + * + * @author msts */ class DependencySource *************** *** 64,71 **** /** Constructor. - * @param plug Plugin that is source of dependency. * * Inserts plug to the implList and set source type. This constructor * is only way to set class members. */ public DependencySource(IPlugin plug) --- 74,82 ---- /** Constructor. * * Inserts plug to the implList and set source type. This constructor * is only way to set class members. + * + * @param plug Plugin that is source of dependency. */ public DependencySource(IPlugin plug) *************** *** 76,81 **** } ! /** Increase usage counter. ! * @param plug Plug to by put. * * Call this when plugin with the same type as source is source of --- 87,91 ---- } ! /** Insert implementator to the DependencySource. * * Call this when plugin with the same type as source is source of *************** *** 83,86 **** --- 93,98 ---- * If implementation of plug is not already in implList, insert it * to the list ... [truncated message content] |
From: Michal H. <ms...@us...> - 2005-09-15 18:11:11
|
Update of /cvsroot/exfex/exfex/source/exfex/common/security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5834/source/exfex/common/security Modified Files: IIdentity.java Log Message: documentation corrected som code fixing Index: IIdentity.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/security/IIdentity.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IIdentity.java 13 Sep 2005 20:57:25 -0000 1.1 --- IIdentity.java 15 Sep 2005 18:11:03 -0000 1.2 *************** *** 9,30 **** * test validity of id, Security manager can change this number as it * need). ! * <br> * Each owner of resource(s) have to have its identity for capability * checking. First identity object is returned after login process. Then * it will be required allways where security is needed. * - * @author msts * - * TODO change return types to bigger numbers * * Changes: * 20.8.2005 msts - created */ public interface IIdentity { ! /** Returns identificator. */ public long getId(); ! /** Returns key of. */ public long getKey(); } --- 9,42 ---- * test validity of id, Security manager can change this number as it * need). ! * <p> * Each owner of resource(s) have to have its identity for capability * checking. First identity object is returned after login process. Then * it will be required allways where security is needed. * * * + * + * <pre> + * TODO change return types to bigger numbers + * * Changes: * 20.8.2005 msts - created + * </pre> + * + * + * @author msts */ public interface IIdentity { ! /** Returns identificator. ! * ! * @return Identification number. ! */ public long getId(); ! /** Returns key of. ! * ! * @return Key number. ! */ public long getKey(); } |
From: Michal H. <ms...@us...> - 2005-09-13 20:57:37
|
Update of /cvsroot/exfex/exfex/source/exfex/common/security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1938 Added Files: IIdentity.java Log Message: Identity class --- NEW FILE: IIdentity.java --- package exfex.common.security; /** Basic interface identity. * * This interface describes identity. Identity consists of id number * (this number is unique in whole Security Manager and it's used as * key to find out identity credentials) and temporary key (used to * test validity of id, Security manager can change this number as it * need). * <br> * Each owner of resource(s) have to have its identity for capability * checking. First identity object is returned after login process. Then * it will be required allways where security is needed. * * @author msts * * TODO change return types to bigger numbers * * Changes: * 20.8.2005 msts - created */ public interface IIdentity { /** Returns identificator. */ public long getId(); /** Returns key of. */ public long getKey(); } |
From: Michal H. <ms...@us...> - 2005-09-13 20:56:19
|
Update of /cvsroot/exfex/exfex/source/exfex/common/security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1677/security Log Message: Directory /cvsroot/exfex/exfex/source/exfex/common/security added to the repository |
From: Pavel O. <pa...@us...> - 2005-09-11 21:55:48
|
Update of /cvsroot/exfex/exfex/source/exfex/common/pluginsystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24217 Modified Files: AcceptPlugin.java Log Message: Added exceptions Index: AcceptPlugin.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/AcceptPlugin.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AcceptPlugin.java 31 Aug 2005 15:51:07 -0000 1.9 --- AcceptPlugin.java 11 Sep 2005 21:55:40 -0000 1.10 *************** *** 10,13 **** --- 10,16 ---- * * $Log$ + * Revision 1.10 2005/09/11 21:55:40 pavel_o + * Added exceptions + * * Revision 1.9 2005/08/31 15:51:07 mstsxfx * bug fix - getByName, getByIface *************** *** 108,112 **** catch (Exception e) { ! } } --- 111,115 ---- catch (Exception e) { ! throw new PluginException("Plugin attaching error."); } } *************** *** 208,212 **** rwl.readLock().unlock(); ! // TODO - plugin not found return retPlugin; } --- 211,218 ---- rwl.readLock().unlock(); ! ! if (retPlugin == null) ! throw new PluginException("Plugin of specified type with name \"" + name + "\" not found."); ! return retPlugin; } *************** *** 236,239 **** --- 242,248 ---- rwl.readLock().unlock(); + if (retList == null) + throw new PluginException("PluginList of specified type not found."); + return retList; } |
From: Michal H. <ms...@us...> - 2005-09-06 17:50:54
|
Update of /cvsroot/exfex/exfex/source/exfex/common/logging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19923 Modified Files: ILogger.java Logger.java LogManager.java NullLogger.java Log Message: new 2 layers model Index: LogManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/LogManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LogManager.java 17 Aug 2005 11:44:45 -0000 1.5 --- LogManager.java 6 Sep 2005 17:50:45 -0000 1.6 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.6 2005/09/06 17:50:45 mstsxfx + * new 2 layers model + * * Revision 1.5 2005/08/17 11:44:45 mstsxfx * logging corrected *************** *** 43,46 **** --- 46,63 ---- * many readers are allowed but only one writer for managing loggers (those * are synchronized too - with synchronized methods). + * <br> + * <b>Loggers identification</b>: All loggers can be identified by their names. + * There are no restrictions on names form with exception, that empty (not null) + * stands for standard error output. Logger name is bind to target, which can + * be file (at the moment - preparing for general URL). They are bound together + * in Destination class. + * + * @see Destination + * <br> + * <b>Loggers sharing</b>: All loggers with same file target are shared. This + * means that LogManager gaurantee, that this loggers will have same low level + * logger device. Logger can set their logic (prefix, log level, etc.) upon + * logger device but loger device guarantee that printed messages won't be + * messed in multithread environment and phisical file will be opend just onced. * * @author msts *************** *** 79,88 **** /** Table of (name, Logger) pairs. */ private Hashtable<String,ILogger> loggerMap=new Hashtable<String,ILogger>(); ! /** Table of (descriptor, Logger) pairs. ! * descriptor is system depended opaque handler to file stream. This is ! * used to find out same destinations (and so logger can be shared ! * between same files. */ ! private Hashtable<String,ILogger> descriptorMap=new Hashtable<String,ILogger>(); /** Constructor with no configuration. --- 96,104 ---- /** Table of (name, Logger) pairs. */ private Hashtable<String,ILogger> loggerMap=new Hashtable<String,ILogger>(); ! /** Table of (filename, ILoggerStream) pairs. ! * This is table is used to find out same destinations (and so ! * logger streams can be shared between same files. */ ! private Hashtable<String,ILoggerStream> descriptorMap=new Hashtable<String,ILoggerStream>(); /** Constructor with no configuration. *************** *** 92,96 **** * no configuration is available. * ! * @see registerDestination */ private LogManager() --- 108,112 ---- * no configuration is available. * ! * @see registerFileDestination */ private LogManager() *************** *** 111,115 **** * Uses STANDARD_LOG logger to log information. * ! * @see registerDestination * @see exfex.common.settings.SettingManager * @see ILogger --- 127,131 ---- * Uses STANDARD_LOG logger to log information. * ! * @see registerFileDestination * @see exfex.common.settings.SettingManager * @see ILogger *************** *** 151,155 **** String filename=properties.getProperty(name); Destination dest=new Destination(name,filename); ! registerDestination(dest); } --- 167,171 ---- String filename=properties.getProperty(name); Destination dest=new Destination(name,filename); ! registerFileDestination(dest); } *************** *** 197,204 **** * * Registers new destination where dest.getTarget() is file name. ! * Find out if destination name is registered. If so, it will exist ! * method. If there is not such destination name, try to find if ! * there is logger with the same target and if so, share this logger ! * and return from method. * <br> * NOTE: Two file targets are supposed to be same iff getCanonicalPath --- 213,232 ---- * * Registers new destination where dest.getTarget() is file name. ! * Empty (not null) file name stands for standard error output. ! * <br> ! * If dest or any of its fields is null, immediately return (doesn't ! * complain). ! * <br> ! * When creating logger, at first find out if destination name is ! * registered already. If so, it will exit method, because it's nothing ! * to do. If there is not such destination name, it will try to create ! * new logger. At the beginig try to find out if there is already logger ! * stream (low level logger device) associated with the same file. If ! * found uses this logger stream to create high level logger (logger ! * device is shared). If no such device found, creates new one from file ! * stream. ! * <br> ! * NOTE: To keep information about all registered (file, logger device) ! * uses descriptorMap. * <br> * NOTE: Two file targets are supposed to be same iff getCanonicalPath *************** *** 215,221 **** public void registerFileDestination(Destination dest)//{{{ { ! getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination Registering new file destination name=\""+dest.getName()+"\" target=\""+dest.getTarget()+"\""); wLock.lock(); // If there is such destination registered, ignore without error if (loggerMap.get(dest.getName())!=null) --- 243,252 ---- public void registerFileDestination(Destination dest)//{{{ { ! if(dest==null || dest.getName()==null || dest.getTarget()==null) ! return; wLock.lock(); + getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination Registering new file destination name=\""+dest.getName()+"\" target=\""+dest.getTarget()+"\""); + // If there is such destination registered, ignore without error if (loggerMap.get(dest.getName())!=null) *************** *** 227,234 **** } ! // test for shared loggers -> ask descriptorMap // key in descriptorMap is canonical name of the ! // target or empty string if stderr is required ! ILogger logger=null; String abspath; if(dest.getTarget().length()>0) --- 258,265 ---- } ! // test for shared loggerstream -> ask descriptorMap // key in descriptorMap is canonical name of the ! // target or empty string if stderr is requiered ! ILoggerStream stream=null; String abspath; if(dest.getTarget().length()>0) *************** *** 246,277 **** abspath=new String(""); ! logger=descriptorMap.get(abspath); ! if(logger!=null) ! { ! // Inserts in the table ! loggerMap.put(dest.getName(),logger); ! ! getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination Using shared logger "+logger); ! ! wLock.unlock(); ! return; ! } ! ! // gets outputstream from target - if target is empty string ! // uses standard error output ! OutputStream out; ! try { ! out=createFileOutput(dest.getTarget()); ! }catch(Exception e) { ! getLogger("STANDARD_LOG").log(ILogger.Level.ERROR,"Can't create stream for "+dest.getTarget()+" reason="+e.getMessage()); ! ! ! wLock.unlock(); ! //throw new TODO ! return; } String prefix=null; int level=7; --- 277,310 ---- abspath=new String(""); ! stream=descriptorMap.get(abspath); ! if(stream!=null) { ! // Shared logger stream ! getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination Using shared logger device "+stream); ! }else { ! // New logger stream ! try ! { ! // creates OutputStream, then DataOutput stream ! // and finaly update descriptorMap ! OutputStream out=createFileOutput(dest.getTarget()); ! stream=new LoggerStream(new DataOutputStream(out)); ! descriptorMap.put(abspath,stream); ! getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination descriptorMap.put("+abspath+", "+stream+")"); ! }catch(Exception e) ! { ! getLogger("STANDARD_LOG").log(ILogger.Level.ERROR,"Can't create stream for "+dest.getTarget()+" reason="+e.getMessage()); ! ! ! wLock.unlock(); ! //throw new TODO ! return; ! } } + // Logger stream is ready, we can do the rest of the job + // that means get prefix, level from Settings + String prefix=null; int level=7; *************** *** 309,320 **** */ ! logger=new Logger(level,out,prefix); ! getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination Using new logger "+logger+" prefix="+prefix+" level="+level); ! // Inserts in the table loggerMap.put(dest.getName(),logger); - descriptorMap.put(abspath,logger); - getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.registerFileDestination descriptorMap.put("+abspath+", "+logger+")"); wLock.unlock(); --- 342,351 ---- */ ! ILogger logger=new Logger(level,stream,prefix); ! getLogger("STANDARD_LOG").log(ILogger.Level.INFO,"Registering logger "+logger+" prefix="+prefix+" level="+level); ! // Inserts (target,logger) pair to the table loggerMap.put(dest.getName(),logger); wLock.unlock(); *************** *** 329,333 **** public void unRegisterFileDestination(Destination dest)//{{{ { ! getLogger("STANDARD_LOG").log(ILogger.Level.DEBUG,"LogManager.unRegisterFileDestination Unregistering file destination name=\""+dest.getName()+"\" target=\""+dest.getTarget()+"\""); wLock.lock(); --- 360,364 ---- public void unRegisterFileDestination(Destination dest)//{{{ { ! getLogger("STANDARD_LOG").log(ILogger.Level.INFO,"Unregistering file destination name=\""+dest.getName()+"\" target=\""+dest.getTarget()+"\""); wLock.lock(); Index: Logger.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/Logger.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Logger.java 17 Aug 2005 11:44:45 -0000 1.5 --- Logger.java 6 Sep 2005 17:50:45 -0000 1.6 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.6 2005/09/06 17:50:45 mstsxfx + * new 2 layers model + * * Revision 1.5 2005/08/17 11:44:45 mstsxfx * logging corrected *************** *** 22,33 **** /** Class for logging information. * ! * Class for logging stuff. It has internal verbosity filter which controls ! * which message should be printed and which supressed. Uses DataOutputStream ! * object as output. Output is created in Constructor from OutputStream.<br> ! * Each logged message has its priority. This number signals importance of ! * the message (lower means more serious with 0 exception). See @link ! * setLogLevel method for filter mechanism. <br> * To provide customizable output, you can define prefix which will be in the ! * begining of each message. This is set also in constructor.<br> * <b>NOTE</b>. * All method are synchrinized so they can be used in multi-threaded --- 25,48 ---- /** Class for logging information. * ! * Class for logging stuff. This implementation of ILogger interface is diveded ! * to 2 layers. High level part controls message filtering according priorities, ! * adds prefix and/or time information. Low level (logger device) is just for ! * writing to the Data output stream. Low level logger device is represented by ! * ILoggerStream implementator (given in constructor or setOutput method. ! * <br> ! * Logger has internal verbosity filter which controls which message should ! * be printed and which supressed. Verbosity filter is represented by logLevel. ! * Each message given to the log method has priority (given also as parameter). ! * This priority is compared with internal logLevel (which is set in constructor ! * or setLogLevel method). If priority is equal or lower than logLevel message ! * is printed using logger device. ! * <br> ! * Message priority is represented by ILogger.Level enum. ! * @see ILogger.Level ! * <br> * To provide customizable output, you can define prefix which will be in the ! * begining of each message. This is set also in constructor. ! * @see log ! * <br> * <b>NOTE</b>. * All method are synchrinized so they can be used in multi-threaded *************** *** 36,40 **** --- 51,60 ---- * @author msts * + * * Changes: + * 5.9.2005 msts - reimplemented - devided to 2 layers (high level and + * low level logger device. This enables sharing logger + * devices instead of whole loggers - all loggers can have + * unique setting and logger devices can be shared) * 10.8.2005 msts - created * *************** *** 59,64 **** private int logLevel; ! /** Stream for output. */ ! private DataOutputStream out; /** Prefix of each loged message. --- 79,84 ---- private int logLevel; ! /** Device to write data. */ ! private ILoggerStream out; /** Prefix of each loged message. *************** *** 89,101 **** * reference, out will be set to System.err stream. */ ! public Logger(int level, OutputStream output, String pref)//{{{ { logLevel=level; ! if(output==null) ! out=new DataOutputStream(System.err); ! else ! out=new DataOutputStream(output); ! log(Level.INFO,this+".Logger created with verbosity="+logLevel+" prefix="+prefix); prefix=pref; }//}}} --- 109,118 ---- * reference, out will be set to System.err stream. */ ! public Logger(int level, ILoggerStream output, String pref)//{{{ { logLevel=level; ! out=output; ! log(Level.INFO,"Created logger "+this+" with verbosity="+logLevel+" prefix="+prefix); prefix=pref; }//}}} *************** *** 108,112 **** * Tests if priority of message is lower (number) then logLevel and if * so print message using out stream. ! * Loged output constit of header and body. Body is message given as * parameter. * <br> --- 125,129 ---- * Tests if priority of message is lower (number) then logLevel and if * so print message using out stream. ! * Loged output consist of header and body. Body is message given as * parameter. * <br> *************** *** 127,146 **** if(priority.ordinal()>Level.NONE.ordinal() && priority.ordinal()<=logLevel) { ! try ! { ! if(displayTime) ! { ! Date now=new Date(); ! // TODO change -user defined format ! String timestr=now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" "; ! out.writeChars(timestr); ! } ! if(prefix!=null) ! out.writeChars(prefix+": "); ! out.writeChars(namedPriorities[priority.ordinal()]+" "+message+"\n"); ! }catch(IOException e) ! { ! // Just ignore FIXME change ! } } --- 144,150 ---- if(priority.ordinal()>Level.NONE.ordinal() && priority.ordinal()<=logLevel) { ! // TODO time format & prefix ! String msg=new String(namedPriorities[priority.ordinal()]+" "+message+"\n"); ! out.println(msg); } *************** *** 151,167 **** * @param output Output stream. * ! * Sets new value of output stream. Old stream is closed and forgotten. */ ! synchronized public void setOutput(OutputStream output)//{{{ { ! log(Level.INFO,this+".setOutput Setting new Output stream\n"); ! try ! { ! out.close(); ! }catch(IOException e) ! { ! log(Level.WARN,this+".setOutput Unable to close old stream ("+e.getMessage()+")"); ! } ! out=new DataOutputStream(output); }//}}} --- 155,164 ---- * @param output Output stream. * ! * Sets new value of output stream. */ ! synchronized public void setOutput(ILoggerStream output)//{{{ { ! log(Level.INFO,"Setting new Output stream for "+this+" (old="+out+" new="+output+")\n"); ! out=output; }//}}} *************** *** 189,193 **** return -1; ! log(Level.INFO,this+".setLogLevel Setting new logLevel from "+logLevel+" to "+level+"\n"); int old=level; logLevel=level; --- 186,190 ---- return -1; ! log(Level.INFO,"Setting new logLevel from "+logLevel+" to "+level+" for "+this); int old=level; logLevel=level; *************** *** 205,208 **** --- 202,206 ---- synchronized public String setPrefix(String pref)//{{{ { + log(Level.INFO,"Setting new prefix from "+prefix+" to "+pref+" for "+this); String old=prefix; prefix=pref; *************** *** 213,225 **** synchronized public void flush()//{{{ { ! log(Level.INFO,this+".flush Flushing output stream."); ! try ! { ! out.flush(); ! }catch(IOException e) ! { ! log(Level.WARN,this+".flush Exception during flush (reason=\""+e.getMessage()+"\")"); ! // TODO ! } }//}}} --- 211,216 ---- synchronized public void flush()//{{{ { ! log(Level.INFO,"Flushing output stream for "+this+"."); ! out.flush(); }//}}} Index: NullLogger.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/NullLogger.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullLogger.java 15 Aug 2005 17:36:06 -0000 1.3 --- NullLogger.java 6 Sep 2005 17:50:45 -0000 1.4 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.4 2005/09/06 17:50:45 mstsxfx + * new 2 layers model + * * Revision 1.3 2005/08/15 17:36:06 mstsxfx * CVS info for file included *************** *** 51,55 **** /** Empty setPrefix method. */ ! public void setOutput(OutputStream out) { } --- 54,58 ---- /** Empty setPrefix method. */ ! public void setOutput(ILoggerStream out) { } Index: ILogger.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/logging/ILogger.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ILogger.java 15 Aug 2005 17:31:53 -0000 1.3 --- ILogger.java 6 Sep 2005 17:50:45 -0000 1.4 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.4 2005/09/06 17:50:45 mstsxfx + * new 2 layers model + * * Revision 1.3 2005/08/15 17:31:53 mstsxfx * CVS info fot file included *************** *** 36,40 **** * @param output Output stream where to log messages. */ ! public void setOutput(OutputStream output); /** Log level setter. --- 39,43 ---- * @param output Output stream where to log messages. */ ! public void setOutput(ILoggerStream output); /** Log level setter. |
From: Michal H. <ms...@us...> - 2005-09-06 17:50:41
|
Update of /cvsroot/exfex/exfex/source/exfex/common/logging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19842 Added Files: LogManagerException.java Log Message: Exception class --- NEW FILE: LogManagerException.java --- package exfex.common.logging; /** Basic exception for logging manager. */ public class LogManagerException extends Exception { public LogManagerException(String msg) { super(msg); } } |
From: Michal H. <ms...@us...> - 2005-09-06 17:43:23
|
Update of /cvsroot/exfex/exfex/source/exfex/common/logging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18487 Added Files: LoggerStream.java ILoggerStream.java Log Message: Low level logger device --- NEW FILE: LoggerStream.java --- package exfex.common.logging; import java.io.DataOutputStream; import java.io.IOException; /** Low level logger. * * Implementator of the ILoggerStream interafce (low level logger device). * This class is used to write data given from high level ILogger implementator. * <br> * All data are writen to the DataOutputStream created in constructor (or set * by setOutput method. * <br> * Methods are synchronized, so class can be used as a shared output for * loggers. * * @author msts * * Changes: * 5.9.2005 msts - created */ class LoggerStream implements ILoggerStream { private DataOutputStream output; private LoggerStream() { } public LoggerStream(DataOutputStream stream) { output=stream; } /** Prints message to the output stream. * @param message Message to write. * * Writes message to the output stream. If no output stream is * specified (output is null), just ignore and does nothing. */ synchronized public void println(String message)//{{{ { // Try to write data to output stream, If exception // just write error message to the standard error output try { output.writeBytes(message); }catch(IOException e) { System.err.println("LoggerStream "+this+" can't write to "+output+" reason="+e.getMessage()); } }//}}} /** Sets new output stream. * @param stream New output stream. * * Flushes old output stream and sets new one from given parameter. */ synchronized public void setOutput(DataOutputStream stream)//{{{ { flush(); output=stream; }//}}} /** Force flush on the output. */ synchronized public void flush()//{{{ { try { output.flush(); }catch(Exception e) { //FIXME Ignoring now } }//}}} } --- NEW FILE: ILoggerStream.java --- package exfex.common.logging; import java.io.DataOutputStream; /** Public low level logger device interface. * * This interface stands for Low level Logger device. * Implementator of this interface is used by ILogger implementator to write * concrete data to logger target. As output uses DataOutputStream. * All methods should be synchronized to prevent confusing of output from * multithread environment. If more ILogger's implementators have same file * target, implementator of ILoggerStream is shared. * * @author msts * * Changes: * 5.9.2005 msts - created */ public interface ILoggerStream { /** Prints message to the output stream. * @param message Message to write. */ public void println(String message); /** Close output stream and sets new one. * @param stream New stream to set. * * Fulsh old stream and sets given as new output. */ public void setOutput(DataOutputStream stream); /** Flushes output. */ public void flush(); } |
From: Michal H. <ms...@us...> - 2005-09-04 19:11:27
|
Update of /cvsroot/exfex/exfex/source/exfex/common/pluginsystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8977 Modified Files: PluginManager.java Log Message: strategySelect declaration changed NAMEMATCH strategy implemented in strategySelect Index: PluginManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/PluginManager.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PluginManager.java 17 Aug 2005 11:43:42 -0000 1.10 --- PluginManager.java 4 Sep 2005 19:11:17 -0000 1.11 *************** *** 6,9 **** --- 6,13 ---- * * $Log$ + * Revision 1.11 2005/09/04 19:11:17 mstsxfx + * strategySelect declaration changed + * NAMEMATCH strategy implemented in strategySelect + * * Revision 1.10 2005/08/17 11:43:42 mstsxfx * print replaced with LogManager logging *************** *** 332,335 **** --- 336,340 ---- /** Selects one plugin from list according strategy. * @param strategy Strategy object. + * @param data Additional data string. * @param list List of plugings. * *************** *** 338,349 **** * @return plugin. */ ! static public IPlugin strategySelect(IPluginStrategy strategy, List<IPlugin> list)//{{{ { switch(strategy.getType()) { case FIRST: return (IPlugin)list.get(0); } ! return null; }//}}} --- 343,366 ---- * @return plugin. */ ! static public IPlugin strategySelect(IPluginStrategy strategy, String data, List<IPlugin> list)//{{{ { + IPlugin result=null; switch(strategy.getType()) { case FIRST: return (IPlugin)list.get(0); + case NAMEMATCH: + for(IPlugin plg : list) + { + // compares plugins' names to given + // data (assumed to be expected plugin + // name) + if(plg.getName().equals(data)) + return plg; + } + break; + } ! return result; }//}}} *************** *** 661,665 **** List<IPlugin> readycands=readyList.searchType(f.getType()); if(readycands!=null) ! ready=strategySelect(strategy,readycands); --- 678,682 ---- List<IPlugin> readycands=readyList.searchType(f.getType()); if(readycands!=null) ! ready=strategySelect(strategy,annot.dependencyName(),readycands); *************** *** 673,677 **** { // cycle in dependencies found ! ready=strategySelect(strategy,resolvecands); LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"PluginManager.solveDependencies cycle found in dependencies "+plugin+" <-> "+ready); } --- 690,694 ---- { // cycle in dependencies found ! ready=strategySelect(strategy,annot.dependencyName(),resolvecands); LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"PluginManager.solveDependencies cycle found in dependencies "+plugin+" <-> "+ready); } *************** *** 691,695 **** // recursively call this method on // that plugin ! IPlugin candidate=strategySelect(strategy,depcands); depList.removePlugin(candidate); if(!solveDependencies(candidate)) --- 708,712 ---- // recursively call this method on // that plugin ! IPlugin candidate=strategySelect(strategy,annot.dependencyName(),depcands); depList.removePlugin(candidate); if(!solveDependencies(candidate)) *************** *** 731,738 **** // register plugin - LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"PluginManager.solveDependencies calling "+plugin+".registerMe"); plugin.registerMe(); // Add to the readyList (ready to work) readyList.addPlugin(plugin); return true; }//}}} --- 748,755 ---- // register plugin plugin.registerMe(); // Add to the readyList (ready to work) readyList.addPlugin(plugin); + LogManager.getInstance().getLogger("PLUGMNG_LOGGER").log(ILogger.Level.DEBUG,"PluginManager.solveDependencies calling "+plugin+".registerMe"); return true; }//}}} |
From: Michal H. <ms...@us...> - 2005-09-04 19:09:48
|
Update of /cvsroot/exfex/exfex/source/exfex/common/pluginsystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8684 Modified Files: PluginList.java Log Message: new toList method Index: PluginList.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/pluginsystem/PluginList.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PluginList.java 14 Aug 2005 14:52:21 -0000 1.5 --- PluginList.java 4 Sep 2005 19:09:40 -0000 1.6 *************** *** 6,9 **** --- 6,12 ---- * * $Log$ + * Revision 1.6 2005/09/04 19:09:40 mstsxfx + * new toList method + * * Revision 1.5 2005/08/14 14:52:21 mstsxfx * all public methods are synchronized *************** *** 208,211 **** --- 211,223 ---- }//}}} + /** Makes copy of the list and returns as List object. + * + * Creates new list (LinkedList) and returns it as List. + */ + synchronized public List<IPlugin> toList() + { + return new LinkedList<IPlugin>(list); + } + /** Returns index of plugin in list. * @param plugin Plugin to search. |
From: Michal H. <ms...@us...> - 2005-09-04 19:09:05
|
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8438 Modified Files: readme Log Message: update Index: readme =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/readme,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** readme 14 Aug 2005 14:32:04 -0000 1.1 --- readme 4 Sep 2005 19:08:48 -0000 1.2 *************** *** 1 **** --- 1,8 ---- Stuff for all graphic interfaces, primitives and DisplayManager interface + + All plugins that uses interfaces from this directory should register themselfs + to DisplayManager. Manager is registered in PluginManager. + DisplayManager should be used by plugins but not clients. + Clients should use manager just to get PrimitivesFactory object (and use + this object to get primitives, event dispatcher, layouts) + |
From: Michal H. <ms...@us...> - 2005-09-04 19:08:39
|
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8360 Modified Files: IDisplayManager.java Log Message: New methods Index: IDisplayManager.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IDisplayManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IDisplayManager.java 31 Aug 2005 18:06:43 -0000 1.3 --- IDisplayManager.java 4 Sep 2005 19:08:31 -0000 1.4 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.4 2005/09/04 19:08:31 mstsxfx + * New methods + * * Revision 1.3 2005/08/31 18:06:43 mstsxfx * documentation *************** *** 28,35 **** * Whole display system recognizes following types of objects: * <ul> - * <li>Layouts - basic graphic object that can be root window (don't mess with - * IWindow) layout. This object has responsibility to reserve main window, - * where all others graphics are displayed. ILayout is basic interface for - * such classes. * <li>Graphic primitives - basic graphic compomenents such as buttons, labels. * This display system produce interface for each primitive. Each primitive --- 31,34 ---- *************** *** 66,76 **** public interface IDisplayManager extends IPlugin, IAcceptPlugin { ! /** Returns all implementators of ILayout interface.*/ ! public List<ILayout> getLayouts(); ! ! /** Returns all implementators of IButton interface. */ ! public List<IButton> getButtons(); ! /** Returns all implementators of ILabel interface. */ ! public List<ILabel> getLabels(); } --- 65,78 ---- public interface IDisplayManager extends IPlugin, IAcceptPlugin { ! /** Returns all implementators of IButtonFactory interface. */ ! public List<IButtonFactory> getButtons(); ! /** Returns all implementators of ILabelFactory interface. */ ! public List<ILabelFactory> getLabels(); ! ! /** Returns all implementators of IPrimitvesFactory interface. */ ! public List<IPrimitivesFactory> getPrimitivesFactory(); ! ! /** Returns implementator of IPrimitvesFactory interface with given name. */ ! public IPrimitivesFactory getPrimitiveFactory(String name); } |
From: Michal H. <ms...@us...> - 2005-09-04 19:07:13
|
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7701 Modified Files: IPrimitivesFactory.java Log Message: Layout removed Index: IPrimitivesFactory.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IPrimitivesFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IPrimitivesFactory.java 31 Aug 2005 18:06:02 -0000 1.2 --- IPrimitivesFactory.java 4 Sep 2005 19:07:00 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.3 2005/09/04 19:07:00 mstsxfx + * Layout removed + * * Revision 1.2 2005/08/31 18:06:02 mstsxfx * Layout add *************** *** 34,49 **** * NOTE: Please use this plugin interface to create GUI's elements and don't * use DisplayManager directly (code will be cleaner). */ public interface IPrimitivesFactory extends IPlugin { - /** Creates plugin depended layout. - * @param setting Setting object for layout. - * - * Use returned value as basic layout where to store all graphic - * primitives. - * - * @return Instance of initialized layout. - */ - public ILayout getLayout(Properties setting); /** Creates plugin depended button. --- 37,47 ---- * NOTE: Please use this plugin interface to create GUI's elements and don't * use DisplayManager directly (code will be cleaner). + * + * @author msts + * + * Changes: */ public interface IPrimitivesFactory extends IPlugin { /** Creates plugin depended button. |
From: Michal H. <ms...@us...> - 2005-09-04 19:05:59
|
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7326 Modified Files: IWindow.java Log Message: New methods Index: IWindow.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IWindow.java 22 Aug 2005 20:28:55 -0000 1.2 --- IWindow.java 4 Sep 2005 19:05:51 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.3 2005/09/04 19:05:51 mstsxfx + * New methods + * * Revision 1.2 2005/08/22 20:28:55 mstsxfx * Display system stuff add *************** *** 14,17 **** --- 17,21 ---- package exfex.common.displaysystem; + import javax.swing.*; import exfex.common.pluginsystem.*; import exfex.common.displaysystem.*; *************** *** 30,33 **** --- 34,49 ---- public void hide(); + /** Enable window. + * + * Enabled window can be target of event. + */ + public void enable(); + + /** Disable window. + * + * Disabled window can't be target of event. + */ + public void disable(); + /** Return window implementation. * *************** *** 43,46 **** * have to be changed too. */ ! public IComponent getGui(); } --- 59,62 ---- * have to be changed too. */ ! public JComponent getGui(); } |
From: Michal H. <ms...@us...> - 2005-09-04 19:05:09
|
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6888 Modified Files: ILayout.java Log Message: ILayout interface invalidate for this moment. Clients should create Layouts by themselfs. DON'T USE THIS INTERFACE Index: ILayout.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ILayout.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ILayout.java 4 Sep 2005 18:59:14 -0000 1.2 --- ILayout.java 4 Sep 2005 19:04:59 -0000 1.3 *************** *** 3,6 **** --- 3,11 ---- * * $Log$ + * Revision 1.3 2005/09/04 19:04:59 mstsxfx + * ILayout interface invalidate for this moment. + * Clients should create Layouts by themselfs. + * DON'T USE THIS INTERFACE + * * Revision 1.2 2005/09/04 18:59:14 mstsxfx * Invalidate for this moment (We will use direct types not general *************** *** 24,28 **** * need to change display core stuff. * ! * TODO */ public interface ILayout --- 29,39 ---- * need to change display core stuff. * ! * @author msts ! * ! * <br> ! * TODO: DON'T use this at the moment. Client should create Layout by himself. ! * ! * Changes: ! * 31.8.2005 msts - created */ public interface ILayout |
From: Michal H. <ms...@us...> - 2005-09-04 19:02:24
|
Update of /cvsroot/exfex/exfex/source/exfex/common/displaysystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6175 Modified Files: ILabel.java IButton.java Log Message: interface definition changed Index: IButton.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/IButton.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IButton.java 14 Aug 2005 20:05:58 -0000 1.1 --- IButton.java 4 Sep 2005 19:02:16 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.2 2005/09/04 19:02:16 mstsxfx + * interface definition changed + * * Revision 1.1 2005/08/14 20:05:58 mstsxfx * Basic interfaces for graphick primitives *************** *** 21,25 **** * 14.8.2005 msts - created */ ! public interface IButton extends IWindow, IEventOnClick { } --- 24,28 ---- * 14.8.2005 msts - created */ ! public interface IButton extends IWindow, ITextAble { } Index: ILabel.java =================================================================== RCS file: /cvsroot/exfex/exfex/source/exfex/common/displaysystem/ILabel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ILabel.java 14 Aug 2005 20:05:58 -0000 1.1 --- ILabel.java 4 Sep 2005 19:02:16 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- * * $Log$ + * Revision 1.2 2005/09/04 19:02:16 mstsxfx + * interface definition changed + * * Revision 1.1 2005/08/14 20:05:58 mstsxfx * Basic interfaces for graphick primitives *************** *** 11,18 **** package exfex.common.displaysystem; - import exfex.common.pluginsystem.*; import exfex.common.displaysystem.*; ! public interface ILabel extends IWindow { } --- 14,24 ---- package exfex.common.displaysystem; import exfex.common.displaysystem.*; ! /** Interface for label graphic primitive. ! * ! * This interface groups all functionality of the label. ! */ ! public interface ILabel extends IWindow, ITextAble { } |