elge.engine.pools
Class ClassPool
java.lang.Object
|
+--elge.engine.pools.ClassPool
- public class ClassPool
- extends Object
This is More important Pool than Object Pool.
Class pool holds classes, that can be con figured and used. The idea is, that you
just make your own class, and do not change the elge code, but only put's the class
to your classpath, and registre it in the the ClassPool. ClassPool will register the class,
if possible - if it meets the restrictions, that the ClassPool defines.
The ClassPool is also suitable for the creation of isntances of classes that are in the
ClassPool and there configuration. So, for example, there is
More examples should be shown:
At first, we should make clear WHAT is WHAT. There will be more class pools...
So, we want MAIN WORLD CLASS POOL
- this should be configured from the application. The application environment.
For example, whe you run elge, the elge.xml is sutable for configure this MAIN POOL CLASS.
Next the MAIN AGENT CLASS POOL
- this should be also configured from the elge.xml, so from the application xml.
Then, there is AGENT CLASS POOL that is in every World instance!!! So every World has it own AGENT
POOL CLASS object, where he can store some classes from the main class. THIS IS IMPORTANT, because
you should not use this pool to register NEW agents, but only to copy them...
--- and how is it with sharing the configuration???
What is where??
OK, this should be written somewhere else, not?? :((( Shit I'm loosing things to work...
The idea is, that you have a registered CLASS, and to this class you have some configurations. OK
So the class should have some place, where to store it's configurations!!! And this is the point.
Where is the path? So we doesn't need to change the config? And, should there be a new configuration
for every simulation? And where to store these configs?
For example, I think, there should be some templates... And these templates can be copied to the simulation
directory.
What if someone will work on one simulation? Is not the idea to store every simulation, if the params are ok?
Maybe, you can have more configurations per a Class in a simulation environment. But, only few of them
will be accepted by the simulation. Put it in this way??
Well yes. And when you want to store whole World Configuration? Well as a new template?
This is the feature I wanted to have.
Well you create a copy of template for some World.,ex. SimpleWorld. The configuration of the world is done than
where? well hmm. Where is it stored? I thing, there should be created a new template, so it should not call
a template but a simulation?????
How to go out from this.
Memorizies the classes... something like loader and selector of
classes...
Lot of static work...
- Author:
- Palino
Constructor Summary |
ClassPool()
Needed for the JavaBean loading... |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USER_SOURCE
public static final String USER_SOURCE
- See Also:
- Constant Field Values
SEARCH_SOURCE
public static final String SEARCH_SOURCE
- See Also:
- Constant Field Values
POOL_CONFIG_FILE
public static final String POOL_CONFIG_FILE
- See Also:
- Constant Field Values
listTemplates
public boolean listTemplates
classes
protected Vector classes
mainClass
protected Class mainClass
pool
protected static Hashtable pool
ClassPool
public ClassPool()
- Needed for the JavaBean loading...
getMainClass
public Class getMainClass()
setMainClass
public void setMainClass(Class mainClass)
reloadClasses
public void reloadClasses()
- Load the pool from the config. Alias, this should be a beam,
so just call unserialize :))
protected void loadPool() {
//tries to load all classes.
//that means, fill up the class in the ClassLoadInfo :)
reloadClasses();
}
autoSearch
public void autoSearch()
- Auto search classes..
addByName
public void addByName(String source,
String forname)
- Parameters:
source
- Who is adding it, system or userforname
- Path to class to be loaded as string
delByNumber
public void delByNumber(int row)
getPoolSize
public int getPoolSize()
getValueAt
public Object getValueAt(int row,
int col)
setValueAt
public void setValueAt(Object value,
int row,
int col)
getClassLoadInfo
public ClassLoadInfo getClassLoadInfo(int row)
- Returns:
- ClassLoadInfo with an index of row
getTemplates
public Vector getTemplates(int row)
- Returns:
- Vector of templates for the row in the pool.
getPoolContent
public Vector getPoolContent()
getRootName
public String getRootName()
setRootName
public void setRootName(String rn)
getListTemplates
public boolean getListTemplates()
setListTemplates
public void setListTemplates(boolean lt)
getTree
public DefaultMutableTreeNode getTree()
getTemplateTree
public DefaultMutableTreeNode getTemplateTree()
addMembers
public DefaultMutableTreeNode addMembers(DefaultMutableTreeNode root,
Iterator it)
addTemplates
public DefaultMutableTreeNode addTemplates(DefaultMutableTreeNode root,
Iterator it)
getPoolConfig
public Vector getPoolConfig()
setPoolConfig
public void setPoolConfig(Vector classLoadInfoVector)
getPool
public static ClassPool getPool(Class poolClass)
addPool
public static ClassPool addPool(Class poolClass)
savePools
public static void savePools()
- Tries to save the pools as beans with the xml config :).
Well, we must try it !
loadPools
public static void loadPools()
- Tuto mu musime nejak dat asi adresar? Alebo tak nejak...
Kazdopadne, nejak sa to musi nahrat :)