rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (log.isDebugEnabled()) { log.debug("Copying society " + this.getSocietyName() + " with assembly " + getAssemblyId() + " into new name " + name); }
public ModifiableComponent copy(String name) { ModifiableComponent component = super.copy(name); // copy the assembly ID - the one under which this societies' // data is currently in the DB, but must be copied ((SocietyBase)component).setAssemblyId(getAssemblyId()); // FIXME: If I do this here, what ab...
log.info("saveToDatabase");
log.info("saveToDatabase society (" + getSocietyName() + " with asb: " + getAssemblyId());
public boolean saveToDatabase() { if(log.isInfoEnabled()) { log.info("saveToDatabase"); } // TODO: // Should I notice when I need to save and only save then? // Should I resist creating a new assembly ID, to avoid // breaking other experiments? Or always create one? String oldCMTAsbid = ...
if(_client == null){ _client = new HttpClient(); if (useProxy()) { _client.getHostConfiguration().setProxy(_proxyHost, _proxyPort); if (useProxyAuthentication()) { _client.getState().setProxyCredentials(_proxyRealm, _proxyHost, new UsernamePasswordCredentials(_proxyUserName, _proxyPasswd)); } } if (useAuthentication())...
HttpClient client = new HttpClient(); if (useProxy()) { client.getHostConfiguration().setProxy(_proxyHost, _proxyPort); if (useProxyAuthentication()) { client.getState().setProxyCredentials(_proxyRealm, _proxyHost, new UsernamePasswordCredentials(_proxyUserName, _proxyPasswd)); }
private HttpClient getClient() { if(_client == null){ _client = new HttpClient(); if (useProxy()) { _client.getHostConfiguration().setProxy(_proxyHost, _proxyPort); if (useProxyAuthentication()) { _client.getState().setProxyCredentials(_proxyRealm, _pro...
return _client;
if (useAuthentication()) { client.getState().setCredentials( _realm, _host, new UsernamePasswordCredentials(_userName, _passwd) ); } return client;
private HttpClient getClient() { if(_client == null){ _client = new HttpClient(); if (useProxy()) { _client.getHostConfiguration().setProxy(_proxyHost, _proxyPort); if (useProxyAuthentication()) { _client.getState().setProxyCredentials(_proxyRealm, _pro...
final InputStream is = get.getResponseBodyAsStream();
public InputStream openStream(URL url) throws IOException { GetMethod get = doGet(url); final InputStream is = get.getResponseBodyAsStream(); return new GETInputStream(get); }
System.out.println("saveToDb");
System.out.println("saveToDb: " + getExperimentName());
public void saveToDb() { System.out.println("saveToDb"); try { Set writtenNodes = new HashSet(); List components = getComponents(); NodeComponent[] nodesToWrite = getNodes(); ComponentData theSoc = new GenericComponentData(); theSoc.setType(ComponentData.SOCIETY); theSoc.setName(ge...
.contains("Forrest Generated (Internal) Document"));
.contains("http:
public void testForrestInternalRequest() throws ProcessingException, URISyntaxException, IOException { final AbstractOutputDocument output = this.controller .getOutputDocument(new URI(INTERNAL_REQUEST_URI)); assertNotNull(output); assertTrue("Content is not as expected", output.getContentAsString() .contain...
.contains("xmlns:html=\"http:
.contains("http:
public void testForrestSourceRequest() throws ProcessingException, URISyntaxException, IOException { final AbstractOutputDocument output = this.controller .getOutputDocument(new URI(SOURCE_REQUEST_URI)); assertNotNull(output); assertTrue("Content is not as expected", output.getContentAsString() .contains("x...
((Factory)this).callback(Callbacks.JDK_PROXY, new HandlerAdapter(h));
((Factory)this).setCallback(Callbacks.JDK_PROXY, new HandlerAdapter(h));
protected Proxy(InvocationHandler h) { ((Factory)this).callback(Callbacks.JDK_PROXY, new HandlerAdapter(h)); }
return ((HandlerAdapter)((Factory)proxy).callback(Callbacks.JDK_PROXY)).handler;
return ((HandlerAdapter)((Factory)proxy).getCallback(Callbacks.JDK_PROXY)).handler;
public static InvocationHandler getInvocationHandler(Object proxy) { return ((HandlerAdapter)((Factory)proxy).callback(Callbacks.JDK_PROXY)).handler; }
return Enhancer.enhanceClass(IMPL_TYPE, interfaces, loader, new CallbackFilter() { public int accept(Member member) { return Callbacks.JDK_PROXY; } });
return Enhancer.enhanceClass(IMPL_TYPE, interfaces, loader, new SimpleFilter(Callbacks.JDK_PROXY));
public static Class getProxyClass(ClassLoader loader, Class[] interfaces) { return Enhancer.enhanceClass(IMPL_TYPE, interfaces, loader, new CallbackFilter() { public int accept(Member member) { return Callbacks.JDK_PROXY; } }); }
runBuilder(societies[0], false, true);
runBuilder((ModifiableConfigurableComponent)societies[0], false, true);
public void actionPerformed(ActionEvent e) { String s = ((AbstractButton)e.getSource()).getActionCommand(); if (s.equals(NEW_MENU_ITEM)) { newWorkspace(); } else if (s.equals(EXIT_MENU_ITEM)) { exit(); } else if (s.equals(HELP_MENU_ITEM)) { URL help = (URL)getClass().getResource(HELP_DOC); ...
runMultipleBuilders(societies);
runMultipleBuilders((ModifiableConfigurableComponent [])societies);
public void actionPerformed(ActionEvent e) { String s = ((AbstractButton)e.getSource()).getActionCommand(); if (s.equals(NEW_MENU_ITEM)) { newWorkspace(); } else if (s.equals(EXIT_MENU_ITEM)) { exit(); } else if (s.equals(HELP_MENU_ITEM)) { URL help = (URL)getClass().getResource(HELP_DOC); ...
public void runBuilder(SocietyComponent cc, boolean alwaysNew,
public void runBuilder(ModifiableConfigurableComponent cc, boolean alwaysNew,
public void runBuilder(SocietyComponent cc, boolean alwaysNew, boolean openForEditing) { if (!cc.isEditable() && openForEditing) { int result = JOptionPane.showConfirmDialog(this, "Society is not editable; create copy?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOption...
"Society is not editable; create copy?", "Society Not Editable",
"Component is not editable; create copy?", "Component Not Editable",
public void runBuilder(SocietyComponent cc, boolean alwaysNew, boolean openForEditing) { if (!cc.isEditable() && openForEditing) { int result = JOptionPane.showConfirmDialog(this, "Society is not editable; create copy?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOption...
cc = organizer.copySociety(cc, null);
cc = organizer.copyComponent(cc, null);
public void runBuilder(SocietyComponent cc, boolean alwaysNew, boolean openForEditing) { if (!cc.isEditable() && openForEditing) { int result = JOptionPane.showConfirmDialog(this, "Society is not editable; create copy?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOption...
alwaysNew, cc.getSocietyName(), (ModifiableConfigurableComponent)cc,
alwaysNew, cc.getShortName(), (ModifiableConfigurableComponent)cc,
public void runBuilder(SocietyComponent cc, boolean alwaysNew, boolean openForEditing) { if (!cc.isEditable() && openForEditing) { int result = JOptionPane.showConfirmDialog(this, "Society is not editable; create copy?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOption...
private void runMultipleBuilders(SocietyComponent[] societies) {
private void runMultipleBuilders(ModifiableConfigurableComponent[] societies) {
private void runMultipleBuilders(SocietyComponent[] societies) { for (int i = 0; i < societies.length; i++) { String s = "Configuration Builder: " + societies[i].getSocietyName(); if (NamedFrame.getNamedFrame().getFrame(s) == null) runBuilder(societies[i], true, true); } }
String s = "Configuration Builder: " + societies[i].getSocietyName();
String s = "Configuration Builder: " + societies[i].getShortName();
private void runMultipleBuilders(SocietyComponent[] societies) { for (int i = 0; i < societies.length; i++) { String s = "Configuration Builder: " + societies[i].getSocietyName(); if (NamedFrame.getNamedFrame().getFrame(s) == null) runBuilder(societies[i], true, true); } }
InitialContext (Hashtable environment)
public InitialContext (Hashtable environment)
InitialContext (Hashtable environment) { init (environment); }
Object propVal) throws NamingException;
Object propVal) throws NamingException { myProps.put (propName, propVal); }
public Object addToEnvironment (String propName, Object propVal) throws NamingException;
return getURLOrDefaultInitCtx (name).destroySubcontext (name);
getURLOrDefaultInitCtx (name).destroySubcontext (name);
public void destroySubcontext (Name name) throws NamingException { return getURLOrDefaultInitCtx (name).destroySubcontext (name); }
gl.glLoadIdentity();
private void recalcInverseRotation(GL gl) { Rotf oriInv = orientation.inverse(); Vec3f tmp = new Vec3f(); float ang = orientation.get(tmp); gl.glLoadIdentity(); if (tmp.lengthSquared() > EPSILON) gl.glRotatef((float) Math.toDegrees(ang), tmp.x(), tmp.y(), tmp.z()); }
if (pattern == null) { return null; } Matcher m = VAR_PATTERN.matcher(pattern); StringBuffer sb = new StringBuffer(); while (m.find()) { String var = m.group(1); String val = (String)variables.get(var); if (val != null) { val = substituteVariables(val, variables); } else { val = m.group(); } m.appendReplacement(sb, v...
return substituteVariables(pattern, variables, new Stack());
public static String substituteVariables(String pattern, Map variables) { // if you supply null, null is what you get if (pattern == null) { return null; } Matcher m = VAR_PATTERN.matcher(pattern); StringBuffer sb = new StringBuffer(); while (m.find()) { ...
public double getCurrentHappiness();
double getCurrentHappiness();
public double getCurrentHappiness();
public float getRating();
float getRating();
public float getRating();
public long getTimeCompleted();
long getTimeCompleted();
public long getTimeCompleted();
for (int i = 0; i < getChildCount(); i++) { removeChild(getChild(i));
while(getChildCount() != 0) { removeChild(getChildCount() - 1);
public void removeAllChildren() { for (int i = 0; i < getChildCount(); i++) { removeChild(getChild(i)); } }
_displayGroup.setSelectsFirstObjectAfterFetch(false);
public WODisplayGroup displayGroup() { if(_displayGroup == null) { _displayGroup = new WODisplayGroup(); if (ERD2WFactory.erFactory().defaultListPageDisplayGroupDelegate() != null) { _displayGroup.setDelegate(ERD2WFactory.erFactory().defaultListPageDisplayGroupDelegate())...
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas = new GLCanvas();
public static void main(String[] args) { Frame frame = new Frame("Translate1 Test"); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.setLayout(new BorderLayout()); GLCanvas canvas = GLDrawableFactory.getF...
RemoteListenable rl = remoteNode.getRemoteListenable(); if (log.isDebugEnabled()) log.debug("Adding listener: " + CSMART.getNodeListenerId() + " for: " + nodeInfo.processName); rl.addListener(nci.listener, CSMART.getNodeListenerId());
if (remoteNode != null) { RemoteListenable rl = remoteNode.getRemoteListenable(); if (log.isDebugEnabled()) log.debug("Adding listener: " + CSMART.getNodeListenerId() + " for: " + nodeInfo.processName); rl.addListener(nci.listener, CSMART.getNodeListenerId()); } else { if (log.isWarnEnabled()) log.warn("Got null proces...
private void attachButton_actionPerformed() { attachButton.setSelected(false); // Before getting this list, make sure our list of possible // things to attach to is up-to-date appServerSupport.refreshAppServers(); ArrayList nodesToAttach = appServerSupport.getNodesToAttach(); if (nodesToAttach == nu...
Thread.sleep(1000);
Thread.sleep(50);
public static void main(String args[]) { try { long start = System.currentTimeMillis(); System.out.println("sleeping"); Thread.sleep(1000); long end = System.currentTimeMillis(); if ((end - start) > 1100 || (end - start) < 990) System.out.println ("failed"); else System.out...
if ((end - start) > 1100 || (end - start) < 990)
if ((end - start) < 50)
public static void main(String args[]) { try { long start = System.currentTimeMillis(); System.out.println("sleeping"); Thread.sleep(1000); long end = System.currentTimeMillis(); if ((end - start) > 1100 || (end - start) < 990) System.out.println ("failed"); else System.out...
return handleException(exception, actionInstance != null ? actionInstance.context() : null);
WOContext context = actionInstance != null ? actionInstance.context() : null; WOResponse response = handleException(exception, context); if(context != null && context.hasSession() && ("InstantiationError".equals(reason) || "InvocationError".equals(reason))) { context._putAwakeComponentsToSleep(); saveSessionForCont...
public WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance) { return handleException(exception, actionInstance != null ? actionInstance.context() : null); ...
writeFile(configDir, xmlFileContents, (String)getProperty(PROP_RWEFILE).getValue()); writeFile(configDir, societyFileContents, (String)getProperty(PROP_SOCIETYFILE).getValue());
writeFile(configDir, xmlFileContents, (String)rweFile); writeFile(configDir, societyFileContents, societyFile);
public void writeConfigFiles(File configDir) throws IOException { writeFile(configDir, xmlFileContents, (String)getProperty(PROP_RWEFILE).getValue()); writeFile(configDir, societyFileContents, (String)getProperty(PROP_SOCIETYFILE).getValue()); }
rweFile = (String) parent.getProperty(PROP_RWEFILE).getValue(); societyFile = (String) parent.getProperty(PROP_SOCIETYFILE).getValue();
rweFile = (String) parent.getFullName().toString() + "_Impacts.xml"; societyFile = (String) parent.getFullName().toString() + "_Society.dat";
public ComponentData getComponentData(ComponentData child) { StringBuffer sb = new StringBuffer(); ABCImpact parent = (ABCImpact)this.getParent(); // Remove this hack when we switch to ComponentData rweFile = (String) parent.getProperty(PROP_RWEFILE).getValue(); societyFile = (String) paren...
plugin.addParameter(parent.getProperty(PROP_RWEFILE).getValue()); plugin.addParameter(this.getFullName().toString());
plugin.addParameter(rweFile); Iterator iter = ((Collection)parent.getDescendentsOfClass(ImpactAgentComponent.class)).iterator(); while(iter.hasNext()) { ImpactAgentComponent iac = (ImpactAgentComponent)iter.next(); if(!iac.isGenerator()) { plugin.addParameter(iac.getFullName().toString()); } }
public ComponentData getComponentData(ComponentData child) { StringBuffer sb = new StringBuffer(); ABCImpact parent = (ABCImpact)this.getParent(); // Remove this hack when we switch to ComponentData rweFile = (String) parent.getProperty(PROP_RWEFILE).getValue(); societyFile = (String) paren...
plugin.addParameter(parent.getProperty(PROP_SOCIETYFILE).getValue());
plugin.addParameter(societyFile);
public ComponentData getComponentData(ComponentData child) { StringBuffer sb = new StringBuffer(); ABCImpact parent = (ABCImpact)this.getParent(); // Remove this hack when we switch to ComponentData rweFile = (String) parent.getProperty(PROP_RWEFILE).getValue(); societyFile = (String) paren...
writer.println(this.getFullName() + ")");
Iterator iter = ((Collection)this.getParent().getDescendentsOfClass(ImpactAgentComponent.class)).iterator(); while(iter.hasNext()) { ImpactAgentComponent iac = (ImpactAgentComponent)iter.next(); if(!iac.isGenerator()) { writer.print(iac.getFullName().toString() + ")\n"); } }
public void writeIniFile(File configDir) throws IOException { File iniFile = new File(configDir, this.getFullName() + ".ini"); PrintWriter writer = new PrintWriter(new FileWriter(iniFile)); try { writer.println("# $id$"); writer.println("[ Cluster ]"); writer.println("class = " + agentClass_name); wr...
lcd.setName((String)getProperty(PROP_RWEFILE).getValue());
lcd.setName(rweFile);
private LeafComponentData createRWELeaf() { GenericLeafComponentData lcd = new GenericLeafComponentData(); StringBuffer sb = new StringBuffer(); lcd.setType(LeafComponentData.FILE); lcd.setName((String)getProperty(PROP_RWEFILE).getValue()); sb.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"); ...
lcd.setName((String)getProperty(PROP_SOCIETYFILE).getValue());
lcd.setName(societyFile);
private LeafComponentData createSocietyLeaf() { GenericLeafComponentData lcd = new GenericLeafComponentData(); StringBuffer sb = new StringBuffer(); lcd.setType(LeafComponentData.FILE); lcd.setName((String)getProperty(PROP_SOCIETYFILE).getValue()); Iterator iter = agentNames.iterator(); while(iter.h...
return "#Node.AgentManager = org.cougaar.tools.csmart.binder.SlowMessageTransportServiceFilter(2,10,10)\n";
StringBuffer buf = new StringBuffer(); ComponentData data = createBinderComponentData(); buf.append(data.getName()); buf.append(" = "); buf.append(data.getClassName()); buf.append("("); Object[] params = data.getParameters(); for(int i=0; i < params.length; i++) { if((i+1) == params.length) { buf.append(params[i] + ")...
public String getNodeFileAddition() { // FIXME!!! return "#Node.AgentManager = org.cougaar.tools.csmart.binder.SlowMessageTransportServiceFilter(2,10,10)\n"; }
propRWEFile = addProperty(PROP_RWEFILE, PROP_RWEFILE_DFLT,
propSamplesPerSecond = addProperty(PROP_SAMPLESPERSECOND, PROP_SAMPLESPERSECOND_DFLT,
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
propKineticCount.setValue(e.getPreviousValue());
propSamplesPerSecond.setValue(e.getPreviousValue());
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
propRWEFile.setToolTip(PROP_RWEFILE_DESC);
propSamplesPerSecond.setToolTip(PROP_SAMPLESPERSECOND_DESC);
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
propSocietyFile = addProperty(PROP_SOCIETYFILE, PROP_SOCIETYFILE_DFLT,
propInMsgsPerSecond = addProperty(PROP_IN_MSGSPERSECOND, PROP_IN_MSGSPERSECOND_DFLT,
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
propKineticCount.setValue(e.getPreviousValue());
propInMsgsPerSecond.setValue(e.getPreviousValue());
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
propSocietyFile.setToolTip(PROP_SOCIETYFILE_DESC);
propInMsgsPerSecond.setToolTip(PROP_IN_MSGSPERSECOND_DESC); propOutMsgsPerSecond = addProperty(PROP_OUT_MSGSPERSECOND, PROP_OUT_MSGSPERSECOND_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { if(((String)e.getProperty().getValue()).equals("")) { propOutMsgsPerSecond...
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
rweFile = (String) getFullName().toString() + "_Impacts.xml"; societyFile = (String) getFullName().toString() + "_Society.dat";
public void initProperties() { propCyberCount = addProperty(PROP_CYBERCOUNT, PROP_CYBERCOUNT_DFLT, new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { int newVal = ((Integer)e.getProperty().getValue()).intValue(); int prevVal = ((Integer)e.getP...
propKineticCount.setValue(e.getPreviousValue());
propSamplesPerSecond.setValue(e.getPreviousValue());
public void propertyValueChanged(PropertyEvent e) { if(((String)e.getProperty().getValue()).equals("")) { propKineticCount.setValue(e.getPreviousValue()); } }
propKineticCount.setValue(e.getPreviousValue());
propInMsgsPerSecond.setValue(e.getPreviousValue());
public void propertyValueChanged(PropertyEvent e) { if(((String)e.getProperty().getValue()).equals("")) { propKineticCount.setValue(e.getPreviousValue()); } }
if(child.getType() == ComponentData.AGENT) {
if(child.getType() == ComponentData.NODE) { child.addChild(0, createBinderComponentData()); } else if(child.getType() == ComponentData.AGENT) {
public void processData(ComponentData data) { ComponentData[] children = data.getChildren(); for(int i=0; i < children.length; i++) { ComponentData child = children[i]; if(child.getType() == ComponentData.AGENT) { // Process it. if(child.getName().equals(generatorAgent.getFullName().toString())) {...
public com.webobjects.eocontrol.EODataSource dataSource();
public EODataSource dataSource();
public com.webobjects.eocontrol.EODataSource dataSource();
setOrientation(params.getOrientation()); setModelviewMatrix(params.getModelviewMatrix()); setProjectionMatrix(params.getProjectionMatrix());
public void set(CameraParameters params) { setPosition(params.getPosition()); setForwardDirection(params.getForwardDirection()); setUpDirection(params.getUpDirection()); setVertFOV(params.getVertFOV()); setImagePlaneAspectRatio(params.getImagePlaneAspectRatio()); setXSize(params.getXSize()); setY...
if (this == o) return true; if (o instanceof SimpleName && ((SimpleName)o).name == name) return true;
public boolean equals(Object o) { if (o instanceof CompositeName) { return compareTo(o) == 0; } return false; }
private void addExperimentAndComponentsToWorkspace(Experiment experiment,
protected void addExperimentAndComponentsToWorkspace(Experiment experiment,
private void addExperimentAndComponentsToWorkspace(Experiment experiment, DefaultMutableTreeNode node) { DefaultMutableTreeNode expNode = addExperimentToWorkspace(experiment, node); SocietyComponent societyComponent = experiment.getSocietyComponent(); String societ...
if(false) { String cp = System.getProperty("java.class.path"); String parts[] = cp.split(":"); String normalLibs = ""; String systemLibs = ""; for (int i = 0; i < parts.length; i++) { String jar = parts[i]; if(jar.matches("Library.Frameworks.Java")) { systemLibs += jar + ":"; } else { normalLibs += jar + ":"; } } if(sy...
public static void main(String argv[], Class applicationClass) { _wasERXApplicationMainInvoked = true; ERXConfigurationManager.defaultManager().setCommandLineArguments(argv); ERXFrameworkPrincipal.setUpFrameworkPrincipalClass (ERXExtensions.class); WOApplication.main(argv, applicationCla...
rd.setType(typeId); rd.setItem(itemId); rd.setRole(roleName); rd.setSupported(otherClusterId);
rd.setType(roleName); rd.setTypeId(otherClusterId); rd.setRole(typeId);
protected int fillRelationships(int newVal, StreamTokenizer tokens, AgentAssetData aad) throws IOException { if(log.isDebugEnabled()) { log.debug("Entering fillRelationships"); } RelationshipData rd = null; newVal = tokens.nextToken(); while ((newVal != StreamToken...
log.error("Please report seeing Bug 1279: Child " + i + " out of " + parent.childCount() + " is null in " + parent.getName() + " while considering adding " + self.getName(), new Throwable());
log.error("Please report seeing Bug 1279: Using CSMART " + CSMART.writeDebug() + " Child " + i + " out of " + parent.childCount() + " is null in " + parent.getName() + " while considering adding " + self.getName() + " with class " + self.getClassName(), new Throwable());
public static boolean alreadyAdded(final ComponentData parent, final ComponentData self) { Logger log = CSMART.createLogger(GenericComponentData.class.getName()); if (self == null || parent == null) return true; ComponentData[] children = parent.getChildren(); if (children == null) return false;...
_project.log(_buf + msg);
_task.log(_buf + msg);
public void endProgress(String msg) { _project.log(_buf + msg); _buf.setLength(0); _lastProgressFlush = 0; }
_project.log(msg, level);
_task.log(msg, level);
public void log(String msg, int level) { _project.log(msg, level); }
if (_project != null) {
if (_task != null) {
public void progress() { _buf.append("."); if (_lastProgressFlush == 0) { _lastProgressFlush = System.currentTimeMillis(); } if (_project != null) { // log with ant causes a new line -> we do it only once in a while if (System.currentTimeMillis() - _lastP...
_project.log(_buf.toString());
_task.log(_buf.toString());
public void progress() { _buf.append("."); if (_lastProgressFlush == 0) { _lastProgressFlush = System.currentTimeMillis(); } if (_project != null) { // log with ant causes a new line -> we do it only once in a while if (System.currentTimeMillis() - _lastP...
if (ch < 128 && (ch != 0 || standardUTF8))
if ((hi_part != 0 && (ch <= 0xDBFF || ch > 0xDFFF)) || (hi_part == 0 && ch >= 0xDC00 && ch <= 0xDFFF)) { --inpos; ++inlength; buf[count++] = (byte) (0xE0 | (hi_part >> 12)); value = hi_part; hi_part = 0; avail--; bytes_todo = 2; } else if (ch < 128 && (ch != 0 || standardUTF8))
public int write (char[] inbuffer, int inpos, int inlength) { int start_pos = inpos; int avail = buf.length - count; for (;;) { if (avail == 0 || (inlength == 0 && bytes_todo == 0)) break; // The algorithm is made more complicated because we want to write // at least one byte in the output buffer, if...
buf[count++] = (byte) (0xF0 | ((ch-0xD800) >> 8)); avail--;
public int write (char[] inbuffer, int inpos, int inlength) { int start_pos = inpos; int avail = buf.length - count; for (;;) { if (avail == 0 || (inlength == 0 && bytes_todo == 0)) break; // The algorithm is made more complicated because we want to write // at least one byte in the output buffer, if...
hi_part = 0;
public int write (char[] inbuffer, int inpos, int inlength) { int start_pos = inpos; int avail = buf.length - count; for (;;) { if (avail == 0 || (inlength == 0 && bytes_todo == 0)) break; // The algorithm is made more complicated because we want to write // at least one byte in the output buffer, if...
assertTrue(MethodProxy.getSuperName(obj.getClass(), method).equals("CGLIB$$ACCESS_getFirstName_0"));
public void testAround() throws Throwable { AroundDemo demo = (AroundDemo)Enhancer.create(AroundDemo.class, null, new MethodInterceptor() { public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { ...
assertTrue(MethodProxy.getSuperName(obj.getClass(), method).equals("CGLIB$$ACCESS_getFirstName_0"));
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("getFirstName")) { assertTrue(MethodProxy.getSuperName(obj.getClass(), method).equals("C...
public final boolean isRegistered (String name)
public final boolean isRegistered ()
public final boolean isRegistered (String name) { return !name.startsWith ("x-") && !name.startsWith ("X-"); }
return !name.startsWith ("x-") && !name.startsWith ("X-");
return (!canonicalName.startsWith ("x-") && !canonicalName.startsWith ("X-"));
public final boolean isRegistered (String name) { return !name.startsWith ("x-") && !name.startsWith ("X-"); }
pos++;
if (markPos == pos) ++markPos; ++pos;
private int fill() throws IOException { checkStatus(); // Handle the special case of a readLine that has a '\r' at the end of // the buffer. In this case, we'll need to skip a '\n' if it is the // next char to be read. This special case is indicated by 'pos > limit'. boolean retAtEndOfBuffer = false...
soc = new CMTSociety(assemblyIds);
soc = new CMTSociety(experimentName, assemblyIds);
public Experiment createExperiment(String originalExperimentName, String experimentName, String experimentId, String trialId) { // get assembly ids for trial ArrayList assemblyIds = getTrialAssemblyIds(ex...
log = CSMART.createLogger(this.getClass().getName());
public void setupSubscriptions() { log = CSMART.createLogger(this.getClass().getName()); Vector params = getParameters() != null ? new Vector(getParameters()) : null; if ((params.size() < 2) || (params.size() > 4)) { if (log.isDebugEnabled()) { log.debug("MetricsInitializerPlugin Usage: <numPro...
id = processor.evaluateAsString(sect, idXPath); id.trim();
id = processor.evaluateAsString(sect, idXPath).trim();
private Document addIds(Document doc, String elementXPath, String idXPath) throws SAXException { getLogger().debug("## Using element XPath "+elementXPath); NodeList sects = processor.selectNodeList(doc, elementXPath); getLogger().debug("## .. got "+sects.getLength()+" sections"); for (in...
}catch( ClassCastException cce ){
}catch( Source.CheckedException1 e1 ){
public void testCheckedException()throws Throwable{ Source source = (Source)Enhancer.enhance( Source.class, null, NOOP_INTERCEPTOR ); try{ source.throwChecked(); fail("lost exeption"); }catch( ClassCastException cce ){ } }
throw new CloneNotSupportedException();
throw new Source.CheckedException2();
public void testInvalidException()throws Throwable{ MethodInterceptor interceptor = new NoOpInterceptor(){ public Object afterReturn( Object obj, Method method, Object args[], boolean invokedSuper, Object retValFromSuper, java.lang.Throwable e )throw...
if( !( cnse instanceof CloneNotSupportedException ) ){
if( !( cnse instanceof Source.CheckedException2 ) ){
public void testInvalidException()throws Throwable{ MethodInterceptor interceptor = new NoOpInterceptor(){ public Object afterReturn( Object obj, Method method, Object args[], boolean invokedSuper, Object retValFromSuper, java.lang.Throwable e )throw...
throw new CloneNotSupportedException();
throw new Source.CheckedException2();
public Object afterReturn( Object obj, Method method, Object args[], boolean invokedSuper, Object retValFromSuper, java.lang.Throwable e )throws java.lang.Throwable{ throw new CloneNotSupportedException(); }
super((this.out = (out instanceof BufferedOutputStream ? (BufferedOutputStream) out : new BufferedOutputStream(out, 250))));
this.out = out instanceof BufferedOutputStream ? (BufferedOutputStream) out : new BufferedOutputStream(out, 250); this.lock = out;
private OutputStreamWriter(OutputStream out, UnicodeToBytes encoder) { super((this.out = (out instanceof BufferedOutputStream ? (BufferedOutputStream) out : new BufferedOutputStream(out, 250)))); this.converter = encoder; }
System.out.println("org.cougaar.name.server=" + newNameServer);
public void updateNameServerHostName() { Properties defaultNodeArgs = getDefaultNodeArguments(); String oldNameServer = defaultNodeArgs.getProperty("org.cougaar.name.server"); String newNameServer = null; String dfltNameServer = null; String nameServerHost = null; if (oldNameServer != null) { i...
if (getLogger().isDebugEnabled() && location == null) { getLogger().debug("No location matched request with hint " + hint);
if (location == null) { getLogger().error(msg);; throw new Exception(msg);
public String locate(String hint, Map om) throws Exception { String location = null; final InvokeContext context = new InvokeContext(); final Logger contextLogger = getLogger().getChildLogger("ctx"); ContainerUtil.enableLogging(context, contextLogger); ContainerUtil.compose(contex...
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas = new GLCanvas();
public static void main(String[] args) { GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); HDR demo = new HDR(); canvas.addGLEventListener(demo); final Animator animator = new Animator(canvas); demo.setDemoListener(new DemoListener() { public void shutdownDem...
_preferencesEditingContext = ERXExtensions.newEditingContext();
_preferencesEditingContext = ERXEC.newEditingContext();
private EOEditingContext preferencesEditingContext() { if (_preferencesEditingContext==null) _preferencesEditingContext = ERXExtensions.newEditingContext(); return _preferencesEditingContext; }
NDC.pop();
public void appendToResponse(WOResponse r, WOContext c) { setupPhase(); NDC.push("Page: " + getClass().getName()+ (d2wContext()!= null ? (" - Configuration: "+d2wContext().valueForKey("pageConfiguration")) : "")); try { super.appendToResponse(r,c); } finally { /*NDC...
NDC.pop();
public WOActionResults invokeAction(WORequest r, WOContext c) { setupPhase(); WOActionResults result=null; NDC.push("Page: " + getClass().getName()+ (d2wContext()!= null ? (" - Configuration: "+d2wContext().valueForKey("pageConfiguration")) : "")); try { result= super.invokeAc...
NDC.pop();
public void takeValuesFromRequest(WORequest r, WOContext c) { setupPhase(); NDC.push("Page: " + getClass().getName()+ (d2wContext()!= null ? (" - Configuration: "+d2wContext().valueForKey("pageConfiguration")) : "")); try { super.takeValuesFromRequest(r, c); } finally { ...
} else if (_eo.valueForKey(masterKey) == null) {
} else if (_eo.valueForKey(masterKey) != null) {
public void updateSourceObject(Object anEO) { String masterKey = _localRelationshipKey(); Object aSourceObject = _localSourceObject(); boolean isDictionary = (aSourceObject instanceof NSMutableDictionary); NSMutableDictionary _dictionary = (isDictionary) ? (NSMutableDictionary)aSourceObj...
Iterator iter = timezones.entrySet().iterator();
Iterator iter = timezones().entrySet().iterator();
public static String[] getAvailableIDs(int rawOffset) { int count = 0; Iterator iter = timezones.entrySet().iterator(); while (iter.hasNext()) { // Don't iterate the values, since we want to count // doubled values (aliases) Map.Entry entry = (Map.Entry) iter.next(); if (((TimeZone) entry.getValue())....
iter = timezones.entrySet().iterator();
iter = timezones().entrySet().iterator();
public static String[] getAvailableIDs(int rawOffset) { int count = 0; Iterator iter = timezones.entrySet().iterator(); while (iter.hasNext()) { // Don't iterate the values, since we want to count // doubled values (aliases) Map.Entry entry = (Map.Entry) iter.next(); if (((TimeZone) entry.getValue())....
return defaultZone;
return defaultZone();
public static TimeZone getDefault() { return defaultZone; }
TimeZone tz = (TimeZone) timezones.get(ID);
TimeZone tz = (TimeZone) timezones().get(ID);
public static TimeZone getTimeZone(String ID) { // First check timezones hash TimeZone tz = (TimeZone) timezones.get(ID); if (tz != null) { if (tz.getID().equals(ID)) return tz; // We always return a timezone with the requested ID. // This is the same behaviour as with JDK1.2. tz = (TimeZone) tz.clon...
defaultZone = zone;
defaultZone0 = zone;
public static void setDefault(TimeZone zone) { defaultZone = zone; }
public Number border() { Number result=(Number) (hasBinding("border") ? valueForBinding("border") : null);
public Object border() { Object result = (hasBinding("border") ? valueForBinding("border") : null);
public Number border() { Number result=(Number) (hasBinding("border") ? valueForBinding("border") : null); if (result==null) result=ERXConstant.OneInteger; return result; }
this.parent = f;
public DialogWindow (Frame f) { super (f, true); }
p.setLayout (new GridLayout (1, 2));
p.setLayout (new GridLayout (1, 3));
public void init () { text = new Label ("Dialog Test"); text.setAlignment (Label.CENTER); add (text, "North"); text.setVisible (false); Panel p = new PrettyPanel(); Button cb = new Button ("OK"); cb.addActionListener(new ActionListener () { public void actionPerformed (ActionEvent e) { d...
setSize (130, 70);
setSize (240, 120);
public void init () { text = new Label ("Dialog Test"); text.setAlignment (Label.CENTER); add (text, "North"); text.setVisible (false); Panel p = new PrettyPanel(); Button cb = new Button ("OK"); cb.addActionListener(new ActionListener () { public void actionPerformed (ActionEvent e) { d...
public void actionPerformed (ActionEvent e) { cg.setSelectedCheckbox(boxes[val]); }
public void actionPerformed (ActionEvent e) { dispose(); }
public void actionPerformed (ActionEvent e) { cg.setSelectedCheckbox(boxes[val]); }
w.setVisible (true); w.show();
if (w instanceof Dialog) { System.out.println ("Will 'show'"); w.show(); System.out.println ("Has shown"); } else { w.setVisible (true); }
public void actionPerformed (ActionEvent evt) { Button source = (Button) evt.getSource (); if (source==closeButton) { System.getProperties ().list (System.out); dispose(); System.exit (0); } Window w = (Window) windows.get (source); if (w.isVisible ()) w.dispose (); else { w...
public void actionPerformed (ActionEvent e) { dispose(); }
public void actionPerformed (ActionEvent e) { cg.setSelectedCheckbox(boxes[val]); }
public void actionPerformed (ActionEvent e) { dispose(); }
String line;
String line, libName;
public static void main(String[] args) { String line; // Readline.setThrowExceptionOnUnsupportedMethod(true); if (args.length > 1) Readline.load(ReadlineLibrary.byName(args[1])); else Readline.load(ReadlineLibrary.GnuReadline); System.out.println("initializing Readline..."); ...