Initial commit from SVN.

This commit is contained in:
wcrisman
2014-05-30 10:31:51 -07:00
commit b45e56b890
1968 changed files with 370949 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/Class File Services"/>
<classpathentry combineaccessrules="false" kind="src" path="/Common"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation"/>
<classpathentry combineaccessrules="false" kind="src" path="/Orb"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TripleReflectionTest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1 @@
Method #0 = com.de22.foundation.trt.IMiddle.getServer

View File

@@ -0,0 +1 @@
Method #0 = com.de22.foundation.trt.IServer.getStuff

View File

@@ -0,0 +1,104 @@
Method #0 = com.common.util.IList.getLocateComparator
Method #1 = com.common.util.IList.setLocateComparator(com.common.comparison.IComparator;
Method #2 = com.common.util.IList.getOrderComparator
Method #3 = com.common.util.IList.setOrderComparator(com.common.comparison.IComparator;
Method #4 = com.common.util.IIndexedCollection.add(int;java.lang.Object;
Method #5 = com.common.util.IIndexedCollection.remove(int;
Method #6 = com.common.util.IIndexedCollection.get(int;
Method #7 = com.common.util.IIndexedCollection.replace(int;java.lang.Object;
Method #8 = com.common.util.IIndexedCollection.addAll(int;[Ljava.lang.Object;;
Method #9 = com.common.util.IIndexedCollection.addAll(int;com.common.util.ICollection;
Method #10 = com.common.util.IIndexedCollection.addAll(int;[Ljava.lang.Object;;int;int;
Method #11 = com.common.util.IIndexedCollection.addAll(int;com.common.util.IIndexedCollection;int;int;
Method #12 = com.common.util.IIndexedCollection.set(int;java.lang.Object;
Method #13 = com.common.util.IIndexedCollection.getLastIndexOf(java.lang.Object;
Method #14 = com.common.util.IIndexedCollection.indexedIterator
Method #15 = com.common.util.IIndexedCollection.getFirst
Method #16 = com.common.util.IIndexedCollection.moveToLast(int;
Method #17 = com.common.util.IIndexedCollection.moveToLast(java.lang.Object;
Method #18 = com.common.util.IIndexedCollection.move(int;int;
Method #19 = com.common.util.IIndexedCollection.move(java.lang.Object;int;
Method #20 = com.common.util.IIndexedCollection.moveToFirst(int;
Method #21 = com.common.util.IIndexedCollection.moveToFirst(java.lang.Object;
Method #22 = com.common.util.IIndexedCollection.getIndexOf(java.lang.Object;
Method #23 = com.common.util.IIndexedCollection.getLast
Method #24 = com.common.util.ICollection.add(java.lang.Object;
Method #25 = com.common.util.ICollection.remove(java.lang.Object;
Method #26 = com.common.util.ICollection.replace(java.lang.Object;java.lang.Object;
Method #27 = com.common.util.ICollection.replaceAll(com.common.util.ICollection;
Method #28 = com.common.util.ICollection.replaceAll(com.common.util.ICollection;com.common.util.ICollection;
Method #29 = com.common.util.ICollection.toArray
Method #30 = com.common.util.ICollection.toArray(java.lang.Object;
Method #31 = com.common.util.ICollection.addAll(com.common.util.ICollection;
Method #32 = com.common.util.ICollection.addAll([Ljava.lang.Object;;int;int;
Method #33 = com.common.util.ICollection.addAll([Ljava.lang.Object;;
Method #34 = com.common.util.ICollection.addAll(com.common.util.IIndexedCollection;int;int;
Method #35 = com.common.util.ICollection.addAll(com.common.util.IIterator;
Method #36 = com.common.util.ICollection.iterator
Method #37 = com.common.util.ICollection.containsValue(java.lang.Object;
Method #38 = com.common.util.ICollection.getSize
Method #39 = com.common.util.ICollection.removeAll(com.common.util.IIterator;
Method #40 = com.common.util.ICollection.removeAll([Ljava.lang.Object;;int;int;
Method #41 = com.common.util.ICollection.removeAll(com.common.util.ICollection;
Method #42 = com.common.util.ICollection.removeAll([Ljava.lang.Object;;
Method #43 = com.common.util.ICollection.removeAll
Method #44 = com.common.util.ICollection.isChangeable(boolean;
Method #45 = com.common.util.ICollection.isChangeable
Method #46 = com.common.util.ICollection.perform(com.common.event.VoidHandler1;
Method #47 = com.common.util.ICollection.reject(com.common.event.BooleanHandler1;com.common.util.IList;
Method #48 = com.common.util.ICollection.collect(com.common.event.ObjectHandler1;com.common.util.IList;
Method #49 = com.common.util.ICollection.select(com.common.event.BooleanHandler1;com.common.util.IList;
Method #50 = java.io.Externalizable.readExternal(java.io.ObjectInput;
Method #51 = java.io.Externalizable.writeExternal(java.io.ObjectOutput;
Method #52 = com.foundation.util.IManagedCollection.execute(com.foundation.util.IManagedCollection$ICollectionOperation;
Method #53 = com.foundation.util.IManagedCollection.getErrorInfo
Method #54 = com.foundation.util.IManagedCollection.setErrorInfo(java.lang.Object;
Method #55 = com.common.util.ICollection.getFirst
Method #56 = com.foundation.util.ITrackedCollection.resetVirtualObjectChangeFlags
Method #57 = com.foundation.util.ITrackedCollection.reverseObjectChanges
Method #58 = com.foundation.util.ITrackedCollection.reverseVirtualObjectChanges
Method #59 = com.foundation.util.ITrackedCollection.getCollectionChanges(com.common.util.ICollection;com.common.util.ICollection;
Method #60 = com.foundation.util.ITrackedCollection.resetChangeTracking
Method #61 = com.foundation.util.ITrackedCollection.hasCollectionChanges
Method #62 = com.foundation.attribute.IReflectable.getReflected
Method #63 = com.foundation.attribute.IReflectable.isReflection(com.foundation.attribute.ReflectionContext;
Method #64 = com.foundation.attribute.IReflectable.isReflection
Method #65 = com.foundation.attribute.IReflectable.getReflectionContext
Method #66 = com.foundation.attribute.IReflectable.zzrReflectionRegister(com.foundation.attribute.IReflectUpdateHandler;com.foundation.attribute.ReflectRegistrationData;
Method #67 = com.foundation.attribute.IReflectable.reflectionSynchronize(com.foundation.attribute.IReflectUpdateHandler;com.foundation.attribute.AbstractReflectData;com.foundation.attribute.CreateReflectDataContext;
Method #68 = com.foundation.attribute.IReflectable.reflectionUnregister(com.foundation.attribute.IReflectUpdateHandler;
Method #69 = com.foundation.attribute.IReflectable.zzrIsReflection(java.lang.Object;com.foundation.attribute.ReflectionContext;
Method #70 = com.foundation.attribute.IReflectable.zzrGetReflectionContext(java.lang.Object;
Method #71 = com.foundation.attribute.IReflectable.zzrGetReflectionId(java.lang.Object;
Method #72 = com.foundation.attribute.IReflectable.zzrReflectionCreateSafeCopy(java.lang.Object;com.foundation.attribute.ReflectionContext;
Method #73 = com.foundation.attribute.IReflectable.zzrReflectionPreSynchronize(java.lang.Object;com.foundation.attribute.ReflectionContext;com.foundation.attribute.ReflectionContext;com.foundation.common.IEntity;com.foundation.attribute.IReflectable;com.foundation.attribute.ReflectionContext;
Method #74 = com.foundation.attribute.IReflectable.zzrReflectionDestroy(java.lang.Object;
Method #75 = com.foundation.attribute.IReflectable.zzrReflectionInitialize(java.lang.Object;com.foundation.attribute.AbstractReflectData;
Method #76 = com.foundation.attribute.IReflectable.zzrReflectionPostInitialize(java.lang.Object;com.foundation.attribute.AbstractReflectData;
Method #77 = com.foundation.attribute.IReflectable.zzrReflectionLocalRegister(java.lang.Object;com.foundation.attribute.CreateReflectDataContext;
Method #78 = com.foundation.attribute.IReflectable.zzrReflectionGetLastUpdateMessageNumber(java.lang.Object;com.foundation.attribute.IReflectUpdateHandler;
Method #79 = com.foundation.attribute.IReflectable.zzrCollectPostSynchronizeReflectables(java.lang.Object;com.foundation.attribute.CreateReflectDataContext;
Method #80 = com.foundation.clone.ICloneable.cloneObject(com.foundation.metadata.CloneContext;com.foundation.common.MetadataContainer;
Method #81 = com.foundation.metadata.ISupportsContainment.getMonitor
Method #82 = com.foundation.attribute.IReflectCollectionSupport.synchronizeReflection(com.foundation.attribute.IReflectUpdateHandler;com.foundation.attribute.AbstractReflectData;
Method #83 = com.foundation.attribute.IReflectCollectionSupport.unregisterReflection(com.foundation.attribute.IReflectUpdateHandler;
Method #84 = com.foundation.attribute.IReflectSupport.getHash
Method #85 = com.foundation.attribute.IReflectSupport.setHash(int;
Method #86 = com.foundation.attribute.IReflectSupport.completeSynchronization(com.foundation.attribute.AbstractReflectData;com.foundation.attribute.AbstractReflectData;
Method #87 = com.foundation.attribute.IReflectSupport.getReflectionObject
Method #88 = com.foundation.attribute.IReflectSupport.getSynchronizationData(com.foundation.metadata.CloneContext;
Method #89 = com.foundation.attribute.IReflectSupport.updateReflection(com.foundation.attribute.AbstractReflectData;
Method #90 = com.foundation.attribute.IReflectSupport.setCategoryNumber(long;
Method #91 = com.foundation.attribute.IReflectSupport.getCategoryNumber
Method #92 = com.foundation.attribute.IReflectSupport.getReflectedObject
Method #93 = com.foundation.attribute.IReflectSupport.destroyReflection
Method #94 = com.foundation.attribute.IReflectSupport.getSupportedObject
Method #95 = com.foundation.event.IEventEmitter.registerListener(com.foundation.metadata.Event;com.foundation.event.IHandler;boolean;
Method #96 = com.foundation.event.IEventEmitter.registerListener(int;com.foundation.event.IHandler;boolean;
Method #97 = com.foundation.event.IEventEmitter.unregisterListener(int;com.foundation.event.IHandler;
Method #98 = com.foundation.event.IEventEmitter.unregisterListener(com.foundation.metadata.Event;com.foundation.event.IHandler;
Method #99 = com.foundation.util.IInlineCollectionObservable.addCollectionObserver(com.foundation.util.IInlineCollectionObserver;
Method #100 = com.foundation.util.IInlineCollectionObservable.removeCollectionObserver(com.foundation.util.IInlineCollectionObserver;
Method #101 = com.foundation.util.IInlineCollectionObservable.getCollection
Method #102 = com.foundation.util.IInlineIndexedCollectionObservable.addCollectionObserver(com.foundation.util.IInlineIndexedCollectionObserver;
Method #103 = com.foundation.util.IInlineIndexedCollectionObservable.removeCollectionObserver(com.foundation.util.IInlineIndexedCollectionObserver;

View File

@@ -0,0 +1,5 @@
package com.de22.foundation.trt;
public interface IMiddle {
public IServer getServer();
}//IMiddle//

View File

@@ -0,0 +1,7 @@
package com.de22.foundation.trt;
import com.foundation.util.IManagedList;
public interface IServer {
public IManagedList getStuff();
}//IServer//

View File

@@ -0,0 +1,27 @@
package com.de22.foundation.trt;
import com.foundation.model.Model;
import com.foundation.metadata.Attribute;
public class Stuff extends Model {
public static final Attribute NAME = registerAttribute(Stuff.class, "name");
public Stuff() {
}//Stuff()//
public Stuff(String name) {
setName(name);
}//Stuff()//
/**
* Gets the name value.
* @return The name value.
*/
public String getName() {
return (String) getAttributeValue(NAME);
}//getName()//
/**
* Sets the name value.
* @param name The name value.
*/
public void setName(String name) {
setAttributeValue(NAME, name);
}//setName()//
}//Stuff//

View File

@@ -0,0 +1,172 @@
package com.de22.foundation.trt;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import com.common.debug.Debug;
import com.common.io.StreamSupport;
import com.common.util.LiteList;
import com.foundation.util.xml.DocumentBuilder;
import com.foundation.util.xml.IDocument;
import com.foundation.util.xml.INode;
public class Test {
private static final int MAX_COUNT = 10000;
private static void writeVeryLargeTestFile() {
try {
File f = new File("c:/temp/test_data.bin");
FileOutputStream fout = new FileOutputStream(f);
BufferedOutputStream bout = new BufferedOutputStream(fout, 1000);
for(int count = 0; count < MAX_COUNT; count++) {
for(int index = 0; index < 256; index++) {
bout.write(index);
}//for//
// if(count % 100 == 0) {
// bout.flush();
// }//if//
}//for//
bout.flush();
bout.close();
fout.close();
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
}//writeVeryLargeTestFile()//
private static void checkVeryLargeTestFile() {
try {
File f = new File("c:/temp/test_data.bin");
FileInputStream fin = new FileInputStream(f);
BufferedInputStream bin = new BufferedInputStream(fin, 1000);
for(int count = 0; count < MAX_COUNT; count++) {
for(int index = 0; index < 256; index++) {
int next = bin.read();
if(index != next) {
Debug.log("Check failed at position: " + ((count + 1) * index) + "; Expected " + index + " and received " + next);
fin.close();
return;
}//if//
}//for//
}//for//
Debug.log("Check success.");
fin.close();
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
}//checkVeryLargeTestFile()//
/**
* Detects and removes gaps in the end note numbering.
* @param doc
*/
public static void fixEndNoteNumbering(IDocument doc) {
LiteList list = new LiteList(10, 200);
/*
doc.findNodes("pages", list, true);
if(list.getSize() == 1) {
INode endNotesNode = (INode) list.get(0);
list.removeAll();
endNotesNode.findNodes("page", list);
for(int index = 0; index < list.getSize(); index++) {
INode next = (INode) list.get(index);
if(next.hasAttribute("id")) {
next.getAttribute("id").setValue(Integer.toString(index + 1));
}//if//
else {
next.addAttribute("id", Integer.toString(index + 1));
}//else//
String text = next.getAttributeValue("text");
int periodIndex = text.indexOf('.');
text = (index + 1) + text.substring(periodIndex);
next.getAttribute("text").setValue(text);
}//for//
}//if//
*/
doc.findNodes("end-notes", list, true);
if(list.getSize() == 1) {
INode endNotesNode = (INode) list.get(0);
list.removeAll();
endNotesNode.findNodes("note", list);
for(int index = 0; index < list.getSize(); index++) {
INode next = (INode) list.get(index);
if(next.hasAttribute("id")) {
next.getAttribute("id").setValue(Integer.toString(index + 1));
}//if//
else {
next.addAttribute("id", Integer.toString(index + 1));
}//else//
String text = next.getAttributeValue("text");
int periodIndex = text.indexOf('.');
text = (index + 1) + text.substring(periodIndex);
next.getAttribute("text").setValue(text);
}//for//
}//if//
}//fixEndNoteNumbering()//
/**
* @param args
*/
public static void main(String[] args) {
// File x = new File("\\\\misys\\images\\Allscripts\\Store\\201049\\A0248638");
//
// System.out.println(x.getAbsolutePath().replace('\\', '/'));
// System.out.println(x.getParent());
// System.out.println(x.getName());
//writeVeryLargeTestFile();
//checkVeryLargeTestFile();
//System.exit(0);
try {
File f = new File("c:/Users/Administrator/Desktop/Kobel/Kobel.xml");
File f2 = new File("c:/Users/Administrator/Desktop/Kobel/Kobel2.xml");
DocumentBuilder builder = new DocumentBuilder();
//builder.setIgnoreTextWhitespace(Boolean.FALSE);
builder.decodeContent(false);
IDocument doc = builder.readDocument(StreamSupport.readText(f, "UTF8"));
fixEndNoteNumbering(doc);
String out = builder.writeDocument(doc, "UTF8", false);
StreamSupport.writeText(out, f2, "UTF8");
}//try//
catch(Throwable e) {
Debug.log(e);
}
/*
try {
File f = new File("c:/Users/Administrator/Desktop/Kobel 2.txt");
File f2 = new File("c:/Users/Administrator/Desktop/Kobel 2.xml");
DocumentBuilder builder = new DocumentBuilder();
IDocument doc = builder.readDocument(StreamSupport.readText(f, "UTF8"));
String out = builder.writeDocument(doc, "UTF8", false);
StreamSupport.writeText(out, f2, "UTF8");
}//try//
catch(Throwable e) {
Debug.log(e);
}
*/
}
}

View File

@@ -0,0 +1,269 @@
package com.de22.foundation.trt;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import com.common.debug.Debug;
import com.common.debug.DefaultLog;
import com.common.orb.Orb;
import com.common.thread.ActiveScheduler;
import com.common.thread.Scheduler;
import com.common.util.StringSupport;
import com.de22.orb.Address;
import com.de22.orb.NioEngine;
import com.de22.orb.optional.ServerSocketOptions;
import com.de22.orb.optional.SocketOptions;
import com.de22.orb.security.SslSecurityProvider;
import com.foundation.application.Application;
import com.foundation.util.IManagedList;
import com.foundation.util.ManagedList;
/**
* Monitors and controls the starting/stopping of the web server process.
* Also provides an interface for the Web Server Manager tool to connect, login, and access the web server.
*/
public class TripleReflectionTestApplication extends Application {
/** The property file location property. */
public static final String PROPERTY_FILE = "properties";
/** The property name that determines whether we generate proxies. This should only be true during development. */
public static final String PROPERTY_GENERATE_PROXIES = "generate.proxies";
/** The property name that gives us the ip:port for starting the application browser's server socket listener. */
public static final String PROPERTY_APPBROWSER_SERVER_ADDRESS = "application.browser.address";
/** The from address used to send automated emails to contacts. */
public static final String PROPERTY_EMAIL_FROM_ADDRESS = "email.from";
/** The host name for the mail server. */
public static final String PROPERTY_EMAIL_HOST = "email.host";
/** The user name to log in to the mail server. */
public static final String PROPERTY_EMAIL_USER = "email.user";
/** The password to log in to the mail server. */
public static final String PROPERTY_EMAIL_PASSWORD = "email.password";
/** The address to open a server socket on to allow the web server manager to connect. */
public static final String PROPERTY_MANAGER_ADDRESS = "manager.address";
/** The user name the web server manager should use when connecting. */
public static final String PROPERTY_MANAGER_USER = "manager.user";
/** The password the web server manager should use when connecting. */
public static final String PROPERTY_MANAGER_PASSWORD = "manager.password";
/** The optional path to the java bin directory where the java.exe will be found and used for the execution of the web server. If not given then the default system path will be used to find java.exe. */
public static final String PROPERTY_JAVA_BIN_PATH = "java.bin.path";
/** The path to the web server. This may be null if the web server is in the same directory as this web server monitor. */
public static final String PROPERTY_WEB_SERVER_PATH = "web.server.path";
private static final TripleReflectionTestApplication singleton = new TripleReflectionTestApplication();
/** The properties used by the web application. */
private Properties properties;
/** The base directory for the application. This allows the directory to be modified as needed without affecting other setup code. */
private File baseDirectory = new File("./");
/** The non-blocking IO Engine used by the orb. */
private NioEngine nioEngine = null;
/**
* Starts the Petit Teton application.
* <p>Note: This runs the PetitTeton web application in standalone mode.</p>
* @param args None expected.
*/
public static void main(String[] args) {
//Setup the debug log.//
Debug.setLog(new DefaultLog());
getSingleton().startup(System.getProperties());
//Enable the wait for shutdown call on the Mac such that the main thread never dies.//
// getSingleton().waitForShutdown();
}//main()//
/**
* Simplifies retrieving a property from the application's property set.
* @param key The key for the property.
* @return The value of the property, or null if it doesn't exist.
*/
public static String getProperty(String key) {
return getSingleton().getProperties().getProperty(key);
}//getProperty()//
/**
* Gets the one and only instance of the application.
* @return The singleton instance.
*/
public static TripleReflectionTestApplication getSingleton() {
return singleton;
}//getSingleton()//
/**
* TripleReflectionTestApplication constructor.
*/
public TripleReflectionTestApplication() {
}//TripleReflectionTestApplication()//
/**
* Gets the directory containing the application's resources.
* @return The file referencing the application's base path.
*/
public File getBaseDirectory() {
return baseDirectory;
}//getBaseDirectory()//
/**
* Sets the directory containing the application's resources.
* @param baseDirectory The file referencing the application's base path.
*/
public void setBaseDirectory(File baseDirectory) {
this.baseDirectory = baseDirectory == null ? new File("./") : baseDirectory;
}//setBaseDirectory()//
/**
* Gets the set of properties for the application. This should be used in place of System.getProperties().
* @return The properties for this application.
*/
public Properties getProperties() {
return properties;
}//getProperties()//
/* (non-Javadoc)
* @see com.foundation.application.Application#getDefaultRepositoryIdentifier()
*/
public Object getDefaultRepositoryIdentifier() {
return null;
}//getDefaultRepositoryIdentifier()//
/* (non-Javadoc)
* @see com.foundation.application.Application#getMetadataLocation()
*/
public Object getMetadataLocation() {
return null;
}//getMetadataLocation()//
/**
* Gets the optional non-blocking I/O engine.
* @return The io engine used with the sockets.
*/
public NioEngine getNioEngine() {
return nioEngine;
}//getNioEngine()//
/* (non-Javadoc)
* @see com.foundation.application.Application#internalShutdown()
*/
protected void internalShutdown() {
try {
Orb.shutdown();
}//try//
catch(Throwable e) {}
try {
Scheduler.shutdown();
ActiveScheduler.getSingleton().shutdown();
}//try//
catch(Throwable e) {}
super.internalShutdown();
}//internalShutdown()//
/* (non-Javadoc)
* @see com.foundation.application.Application#startup()
*/
protected void startup(java.util.Properties properties) {
String generateProxiesProperty;
boolean generateProxies;
this.properties = properties;
//Load properties from the property file into the system properties.//
if(this.properties.getProperty(PROPERTY_FILE) != null) {
FileInputStream fin = null;
try {
fin = new FileInputStream(new File(".", this.properties.getProperty(PROPERTY_FILE)));
this.properties.load(fin);
}//try//
catch(Throwable e) {
Debug.log("Couldn't load the property file: " + this.properties.getProperty(PROPERTY_FILE));
}//catch//
finally {
try {fin.close();} catch(Throwable e) {}
}//finally//
}//if//
generateProxiesProperty = this.properties.getProperty(PROPERTY_GENERATE_PROXIES);
generateProxies = (generateProxiesProperty != null) && ((generateProxiesProperty.equals("yes")) || (generateProxiesProperty.equals("on")) || (generateProxiesProperty.equals("true")));
//
// //Setup the metadata service.//
// setupMetadataService();
// //Setup the resource service.//
// setupResourceService();
// //Setup the transaction service.//
// setupTransactionService();
// getTransactionService().debug(TransactionService.DEBUG_ALL);
//Setup the ORB.//
Orb.setOrbWrapper(new com.de22.orb.optional.CommonOrbWrapper(new com.de22.orb.development.OrbClassLoader(new File(".", "proxies")), null, null));
try {
nioEngine = new NioEngine(40);
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
try {
//Start the application specific code.//
startApplication();
}//try//
catch(Throwable e) {
//Log all errors that are not caught earlier in the program.//
Debug.log(e);
}//catch//
}//startup()//
/**
* Starts the actual application.
*/
private void startApplication() {
try {
String type = getProperty("type");
if(type.equals("server")) {
Object serverSocketId = Orb.openServerSocket("ServerSocket", new ServerSocketOptions(new Address("localhost:8901"), null, new SocketOptions(1), null, null, 0, 0, null));
final IManagedList stuff = new ManagedList(100);
stuff.add(new Stuff("Hello"));
if(serverSocketId != null) {
Orb.bind(Orb.getProxy(new IServer() {
public IManagedList getStuff() {
return (IManagedList) Orb.getProxy(stuff, IManagedList.class);
}//getStuff()//
}, IServer.class), "Server", null);
}//if//
else {
Debug.log("Unable to start a server socket on 8901");
}//else//
}//if//
else if(type.equals("middle")) {
Object socketId = Orb.openSocket("toServerSocket", new SocketOptions(1, new Address[] {new Address("localhost:8901")}, null, null, null));
if(socketId != null) {
final IServer server = (IServer) Orb.lookup("Server", socketId);
Object serverSocketId = Orb.openServerSocket("ServerSocket", new ServerSocketOptions(new Address("localhost:8902"), null, new SocketOptions(1), null, null, 0, 0, null));
if(serverSocketId != null) {
Orb.bind(Orb.getProxy(new IMiddle() {
public IServer getServer() {
return server;
}//getServer()//
}, IMiddle.class), "Middle", null);
}//if//
else {
Debug.log("Unable to start a server socket on 8902");
}//else//
}//if//
else {
Debug.log("Server not accessable.");
}//else//
}//else if//
else {
Object socketId = Orb.openSocket("toServerSocket", new SocketOptions(1, new Address[] {new Address("localhost:8902")}, null, null, null));
if(socketId != null) {
IMiddle middle = (IMiddle) Orb.lookup("Middle", socketId);
IServer server = middle.getServer();
IManagedList list = server.getStuff();
Debug.log("Finished.");
}//if//
else {
Debug.log("Middle not accessable.");
}//else//
}//else//
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
}//startApplication()//
}//TripleReflectionTestApplication//