rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (! f.canRead()) return false;
public boolean accept(File f) { if (f == null) return false; if (f.isDirectory()) return true; return f.getName().endsWith(".xml"); }
call.execute(); markTriggered(event);
MessageImpl impl = IvyContext.getContext().getMessageImpl(); try { IvyContext.getContext().setMessageImpl(null); call.execute(); markTriggered(event); } finally { IvyContext.getContext().setMessageImpl(impl); }
public void progress(IvyEvent event) { Project project = (Project)IvyContext.getContext().get(IvyTask.ANT_PROJECT_CONTEXT_KEY); if (project == null) { Message.info("ant call trigger can only be used from an ant build. Ignoring."); return; } if (_onlyonce && isTriggered(event)) { Message.verbose("call already...
_editingContext=ERXExtensions.newEditingContext();
_editingContext=ERXEC.newEditingContext();
public static NSArray orderedComponents(EOEditingContext ec) { NSMutableArray result=new NSMutableArray(); if (_cachedComponents==null) { _editingContext=ERXExtensions.newEditingContext(); _cachedComponents=new NSMutableArray(); addChildrenOfComponentToArray(null,_cach...
Frame frame = new Frame("Gear Demo"); GLJPanel drawable = GLDrawableFactory.getFactory().createGLJPanel(new GLCapabilities());
JFrame frame = new JFrame("Gear Demo"); frame.getContentPane().setLayout(new BorderLayout()); GLCapabilities caps = new GLCapabilities(); caps.setAlphaBits(8); final GLJPanel drawable = GLDrawableFactory.getFactory().createGLJPanel(caps); drawable.setOpaque(false); drawable.addGLEventListener(new GearRenderer());
public static void main(String[] args) { Frame frame = new Frame("Gear Demo"); GLJPanel drawable = GLDrawableFactory.getFactory().createGLJPanel(new GLCapabilities()); drawable.addGLEventListener(new GearRenderer()); frame.add(drawable); frame.setSize(300, 300); final Animator animator = new Animato...
drawable.addGLEventListener(new GearRenderer()); frame.add(drawable);
JPanel gradientPanel = new JPanel() { public void paintComponent(Graphics g) { ((Graphics2D) g).setPaint(new GradientPaint(0, 0, Color.WHITE, getWidth(), getHeight(), Color.DARK_GRAY)); g.fillRect(0, 0, getWidth(), getHeight()); } }; gradientPanel.setLayout(new BorderLayout()); frame.getContentPane().add(gradientPanel,...
public static void main(String[] args) { Frame frame = new Frame("Gear Demo"); GLJPanel drawable = GLDrawableFactory.getFactory().createGLJPanel(new GLCapabilities()); drawable.addGLEventListener(new GearRenderer()); frame.add(drawable); frame.setSize(300, 300); final Animator animator = new Animato...
JLabel message = pane.getMessage() != null ? new JLabel((String)pane.getMessage()) : null;
JLabel message = null;
public void installUI(JComponent c) { super.installUI(c); pane = (JOptionPane)c; System.out.println(" -------------: " + pane); JLabel message = pane.getMessage() != null ? new JLabel((String)pane.getMessage()) : null; JButton ok_button = new JButton("Ok"); ok_button.addActionListener(new ActionListener(...
if (pane.getOptions() != null)
Object[] options = null; if (options != null)
public void installUI(JComponent c) { super.installUI(c); pane = (JOptionPane)c; System.out.println(" -------------: " + pane); JLabel message = pane.getMessage() != null ? new JLabel((String)pane.getMessage()) : null; JButton ok_button = new JButton("Ok"); ok_button.addActionListener(new ActionListener(...
for (int i=0; i<pane.getOptions().length; i++)
for (int i=0; i<options.length; i++)
public void installUI(JComponent c) { super.installUI(c); pane = (JOptionPane)c; System.out.println(" -------------: " + pane); JLabel message = pane.getMessage() != null ? new JLabel((String)pane.getMessage()) : null; JButton ok_button = new JButton("Ok"); ok_button.addActionListener(new ActionListener(...
Object o = pane.getOptions()[i];
Object o = options[i];
public void installUI(JComponent c) { super.installUI(c); pane = (JOptionPane)c; System.out.println(" -------------: " + pane); JLabel message = pane.getMessage() != null ? new JLabel((String)pane.getMessage()) : null; JButton ok_button = new JButton("Ok"); ok_button.addActionListener(new ActionListener(...
writer.println("uic = \"" + ac.getName() + "\"");
AgentAssetData aad = ac.getAgentAssetData(); writer.println("uic = " + aad.getUIC());
private void writeAgentFile(File configDir, AgentComponentData ac) throws IOException { PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, ac.getName() + ".ini"))); try { writer.println("[ Cluster ]"); writer.println("class = " + ac.getClassName()); writer.println("uic = \"" ...
if(!assetData.isEntity()) { if (assetData.getUniqueID() != null) {
if (assetData.getUniqueID() != null && !assetData.getUniqueID().equals("")) {
private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(...
if(assetData.getUnitName() != null) {
if(assetData.getUnitName() != null && !assetData.getUnitName().equals("")) {
private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(...
writer.print("[UIC] "); writer.println(quote(assetData.getUIC())); writer.println(); }
if(!assetData.isNewIniFormat()) { writer.print("[UIC] "); writer.println(quote(assetData.getUIC())); writer.println(); }
private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(...
if (assetData.isEntity()) { writer.print(rel.getRole() + " "); writer.print(quote(rel.getItem()) + " "); writer.print(quote(rel.getTypeId()) + " "); writer.print(quote(rel.getSupported()) + " "); long startTime = rel.getStartTime(); long endTime = rel.getEndTime(); if (startTime == 0L || endTime == 0L) { writer.pri...
if(assetData.isNewIniFormat()) { if(log.isInfoEnabled()) { log.info("Writing out new INI file format"); } if (assetData.isEntity()) { writer.print(rel.getType() + " "); writer.print(quote(rel.getItemId()) + " "); writer.print(quote(rel.getTypeId()) + " "); writer.print(quote(rel.getSupported()) + " "); long startTi...
private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(...
writer.print(quote(myDateFormat.format(new Date(startTime))) + " "); writer.println(quote(myDateFormat.format(new Date(endTime))));
writer.print(rel.getType() + " "); writer.print(quote(rel.getSupported()) + " "); writer.println(quote(rel.getRole()) + " ");
private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(...
} else if(assetData.isOrg()) { writer.print(rel.getType() + " "); writer.print(quote(rel.getSupported()) + " "); writer.println(quote(rel.getRole())); } else if(assetData.isTPOrg()){ } else { throw new RuntimeException("Asset Data Type Must be set: Entity, Org or TPOrg"); } }
} }
private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(...
"Society has been or is being; delete anyway?",
"Society has been or is being used; delete anyway?",
private void deleteSociety(DefaultMutableTreeNode node) { SocietyComponent society = (SocietyComponent)node.getUserObject(); if (!society.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Society has been or is being; delete anyway?", "Society Not Editable", JOptionPane.YE...
super.takeValuesFromRequest(r, c);
super.takeValuesFromRequest(r, c); }catch(RuntimeException e) { log.error(e, e); throw e;
public void takeValuesFromRequest(WORequest r, WOContext c) { // Need to make sure that we have a clean plate, every time clearValidationFailed(); NDC.push("Page: " + getClass().getName()+ (d2wContext()!= null ? (" - Configuration: "+d2wContext().valueForKey(Keys.pageConfiguration)) : "")); ...
if (validationLog.isDebugEnabled()) validationLog.debug("Validation failed with exception: " + e + " value: " + value + " keyPath: " + keyPath);
if (validationLog.isDebugEnabled()) { validationLog.debug("Validation failed with exception: " + e + " value: " + value + " keyPath: " + keyPath); }
public void validationFailedWithException(Throwable e, Object value, String keyPath) { if (validationLog.isDebugEnabled()) validationLog.debug("Validation failed with exception: " + e + " value: " + value + " keyPath: " + keyPath); if (shouldCollectValidationExceptions()) { if (e...
if (keyPath.equals("value")) { keyPath = ""+d2wContext().valueForKey("propertyKey"); }
public void validationFailedWithException(Throwable e, Object value, String keyPath) { if (validationLog.isDebugEnabled()) validationLog.debug("Validation failed with exception: " + e + " value: " + value + " keyPath: " + keyPath); if (shouldCollectValidationExceptions()) { if (e...
if(allBundleProps.containsKey(entry.getKey())) {
if(!allBundleProps.containsKey(entry.getKey())) {
public static void bundleDidLoad(NSNotification n) { NSBundle bundle = (NSBundle) n.object(); // System.out.println(bundle.name() + ": " + allFrameworks); allFrameworks.remove(bundle.name()); if(allBundleProps == null) { allBundleProps = new Properties(); } Properties bundleProps = bund...
if (frame == null) return;
private void displayNodeFrame(String nodeName) { JInternalFrame frame = desktop.getNodeFrame(nodeName); try { frame.setIcon(false); frame.setSelected(true); } catch (PropertyVetoException exc) { } }
if (m == null) return;
private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException { Class klass = osc.forClass(); try { Class classArgs[] = {ObjectOutputStream.class}; Method m = getMethod (klass, "writeObject", classArgs); if (m == null) return; Object args[] = {this}; m.invoke (obj, args); } ...
} catch (NoSuchMethodException nsme) {
private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException { Class klass = osc.forClass(); try { Class classArgs[] = {ObjectOutputStream.class}; Method m = getMethod (klass, "writeObject", classArgs); if (m == null) return; Object args[] = {this}; m.invoke (obj, args); } ...
return klass.getDeclaredField(name);
final Field f = klass.getDeclaredField(name); AccessController.doPrivileged(new PrivilegedAction() { public Object run() { f.setAccessible(true); return null; } }); return f;
private static Field getField (Class klass, String name) throws java.lang.NoSuchFieldException { return klass.getDeclaredField(name); }
return klass.getDeclaredMethod(name, args);
final Method m = klass.getDeclaredMethod(name, args); AccessController.doPrivileged(new PrivilegedAction() { public Object run() { m.setAccessible(true); return null; } }); return m;
private static Method getMethod (Class klass, String name, Class[] args) throws java.lang.NoSuchMethodException { return klass.getDeclaredMethod(name, args); }
m = obj.getClass ().getDeclaredMethod ("writeReplace", classArgs);
m = getMethod(obj.getClass(), "writeReplace", classArgs);
public final void writeObject (Object obj) throws IOException { if (useSubclassMethod) { writeObjectOverride (obj); return; } boolean was_serializing = isSerializing; boolean old_mode = setBlockDataMode (false); try { isSerializing = true; boolean replaceDone = false; Object replacedObject...
socket = new DatagramSocket ();
socket = new NIODatagramSocket (new PlainDatagramSocketImpl(), this);
protected DatagramChannelImpl (SelectorProvider provider) throws IOException { super (provider); socket = new DatagramSocket (); }
if (!isOpen()) throw new ClosedChannelException();
public DatagramChannel connect (SocketAddress remote) throws IOException { socket.connect (remote); return this; }
this.blocking = blocking;
socket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT); this.blocking = blocking;
protected void implConfigureBlocking (boolean blocking) throws IOException { this.blocking = blocking; // FIXME }
throw new Error ("Not implemented");
int remaining = dst.remaining(); receive (dst); return remaining - dst.remaining();
public int read (ByteBuffer dst) throws IOException { if (!isConnected ()) throw new NotYetConnectedException (); throw new Error ("Not implemented"); }
throw new Error ("Not implemented");
if (!isOpen()) throw new ClosedChannelException(); try { DatagramPacket packet; int len = dst.remaining(); if (dst.hasArray()) { packet = new DatagramPacket (dst.array(), dst.arrayOffset() + dst.position(), len); } else { packet = new DatagramPacket (new byte [len], len); } boolean completed = false; try { begin();...
public SocketAddress receive (ByteBuffer dst) throws IOException { throw new Error ("Not implemented"); }
throw new Error ("Not implemented");
if (!isOpen()) throw new ClosedChannelException(); byte[] buffer; int offset = 0; int len = src.remaining(); if (src.hasArray()) { buffer = src.array(); offset = src.arrayOffset() + src.position(); } else { buffer = new byte [len]; src.get (buffer); } DatagramPacket packet = new DatagramPacket (buffer, offset, len, ...
public int send (ByteBuffer src, SocketAddress target) throws IOException { throw new Error ("Not implemented"); }
throw new Error ("Not implemented");
return send (src, socket.getRemoteSocketAddress());
public int write (ByteBuffer src) throws IOException { if (!isConnected ()) throw new NotYetConnectedException (); throw new Error ("Not implemented"); }
BaseOutputPlugin plugin;
BaseOutputPlugin plugin = null;
public BaseOutputPlugin getOutputPlugin(final URI requestURI) { BaseOutputPlugin plugin; final String[] names = this.context.getBeanNamesForType(plugin .getClass()); for (int i = 0; i < names.length; i = i + 1) { plugin = (BaseOutputPlugin) this.context.getBean(names[i]); if (plugin.isMatch(requestURI)) { ...
EOEditingContext ec = ERXExtensions.newEditingContext();
EOEditingContext ec = ERXEC.newEditingContext();
public WOComponent newDirector() { // Could use a child context if we didn't want the talent to go to the database EOEditingContext ec = ERXExtensions.newEditingContext(); EOEnterpriseObject director = ERXUtilities.createEO("Talent", ec); // Let's throw to a regular edit page ...
return className.equals("net/sf/cglib/transform/impl/TestEnhancerTransform");
return className.equals("net.sf.cglib.transform.impl.TestEnhancerTransform");
protected ClassTransformerFactory getTransformer() throws Exception { Enhancer e = new Enhancer(); e.setCallbackType(MethodInterceptor.class); final ClassTransformer t = new ClassFilterTransformer(new ClassFilter() { public boolean accept(String className) { return cla...
((Factory)this).setCallback(0, new MethodInterceptor() {
Enhancer.registerCallbacks(getClass(), new Callback[]{new MethodInterceptor() {
public void test() { assertTrue(foo() == 0); ((Factory)this).setCallback(0, new MethodInterceptor() { public Object intercept(Object obj, java.lang.reflect.Method method, Object[] args, MethodProxy proxy) { return new Integer(1); } }); assertTrue(foo(...
}); assertTrue(foo() == 1);
}}); TestEnhancerTransform another = new TestEnhancerTransform(); assertTrue(another.foo() == 1); TestEnhancerTransform proxied = (TestEnhancerTransform)Enhancer.create(getClass(), new MethodInterceptor() { public Object intercept(Object obj, java.lang.reflect.Method method, Object[] args, MethodProxy proxy) { return ...
public void test() { assertTrue(foo() == 0); ((Factory)this).setCallback(0, new MethodInterceptor() { public Object intercept(Object obj, java.lang.reflect.Method method, Object[] args, MethodProxy proxy) { return new Integer(1); } }); assertTrue(foo(...
if (iLib != ReadlineLibrary.PureJava)
if (iLib != ReadlineLibrary.PureJava) {
public static void initReadline(String applicationName) { if (iLib != ReadlineLibrary.PureJava) initReadlineImpl(applicationName); }
}
public static void initReadline(String applicationName) { if (iLib != ReadlineLibrary.PureJava) initReadlineImpl(applicationName); }
public static final void load(ReadlineLibrary lib) {
public static final void load(ReadlineLibrary lib) throws UnsatisfiedLinkError {
public static final void load(ReadlineLibrary lib) { if (lib == iLib) // ok, since objects are immutable return; if (lib == ReadlineLibrary.PureJava) { iLib = lib; return; } System.loadLibrary(lib.getName()); // might throw UnsatisfiedLinkError iLib = lib; }
iCompleter = rlc; setCompleterImpl(rlc);
setCompleterImpl(iCompleter);
public static void setCompleter(ReadlineCompleter rlc) { if (iLib != ReadlineLibrary.PureJava) { iCompleter = rlc; setCompleterImpl(rlc); } else if (iThrowException) throw new UnsupportedOperationException(); }
synchronized (root) { while (true) { try { long now = System.currentTimeMillis(); if (updateNeeded && now > nextUpdate) { save(workspaceFileName); updateNeeded = false; root.notifyAll(); } else if (updateNeeded) { long delay = nextUpdate - now; if (delay > 0) { root.wait(delay); } } else { root.wait(); } } catch (Inter...
createCMTExperiment(parentNode, newExperimentName, newExperimentId, trialId, isCloned); }
public void run() { synchronized (root) { while (true) { try { long now = System.currentTimeMillis(); if (updateNeeded && now > nextUpdate) { save(workspaceFileName); updateNeeded = false; root.notifyAll(); // In case anyone's waiting for the update to finish } else if (updateNeeded) { ...
DefaultMutableTreeNode newNode = addExperimentToWorkspace(experiment, node);
private void createCMTExperiment(DefaultMutableTreeNode node, String experimentName, String experimentId, String trialId, boolean isCloned) { System.out.println("Creating society"...
workspace.setSelection(newNode);
final DefaultMutableTreeNode experimentNode = node; final Experiment newExperiment = experiment; final java.awt.Component glass = ((JFrame)SwingUtilities.getRoot(this)).getGlassPane(); final java.awt.Component c = this; try { SwingUtilities.invokeLater(new Runnable() { public void run() { DefaultMutableTreeNode newNode...
private void createCMTExperiment(DefaultMutableTreeNode node, String experimentName, String experimentId, String trialId, boolean isCloned) { System.out.println("Creating society"...
Hashtable experimentNamesHT = ExperimentDB.getExperimentNames();
experimentNamesHT = ExperimentDB.getExperimentNames(); if (experimentNamesHT == null) { System.out.println("no experiment names"); return; } System.out.println("Experiment names ht: " + experimentNamesHT);
private void selectExperimentFromDatabase(DefaultMutableTreeNode node) { // select experiment from database Hashtable experimentNamesHT = ExperimentDB.getExperimentNames(); Set dbExperimentNames = experimentNamesHT.keySet(); if (dbExperimentNames == null) return; // for debugging, print experiment...
String trialId = dialog.getTrialId();
final String trialId = dialog.getTrialId();
private void selectExperimentFromDatabase(DefaultMutableTreeNode node) { // select experiment from database Hashtable experimentNamesHT = ExperimentDB.getExperimentNames(); Set dbExperimentNames = experimentNamesHT.keySet(); if (dbExperimentNames == null) return; // for debugging, print experiment...
createCMTExperiment(node, dialog.getExperimentName(), dialog.getExperimentId(), trialId, dialog.isCloned());
final DefaultMutableTreeNode parentNode = node; final String newExperimentName = dialog.getExperimentName(); final String newExperimentId = dialog.getExperimentId(); final boolean isCloned = dialog.isCloned(); GUIUtils.timeConsumingTaskStart(this); try { new Thread("") { public void run() { createCMTExperiment(parentN...
private void selectExperimentFromDatabase(DefaultMutableTreeNode node) { // select experiment from database Hashtable experimentNamesHT = ExperimentDB.getExperimentNames(); Set dbExperimentNames = experimentNamesHT.keySet(); if (dbExperimentNames == null) return; // for debugging, print experiment...
System.out.println("ptype="+propertyType.getName()); System.out.println(" val="+((val==null)?"null":val.toString()));
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listen...
public SocketChannelImpl (SelectorProvider provider)
SocketChannelImpl (SelectorProvider provider) throws IOException
public SocketChannelImpl (SelectorProvider provider) { super (provider); socket = new Socket (); }
socket = new Socket ();
socket = new NIOSocket (new PlainSocketImpl(), this);
public SocketChannelImpl (SelectorProvider provider) { super (provider); socket = new Socket (); }
if (connected)
if (!isOpen()) throw new ClosedChannelException(); if (isConnected())
public boolean connect (SocketAddress remote) throws IOException { if (connected) throw new AlreadyConnectedException(); socket.connect (remote, 50); connected = true; return blocking; // FIXME }
socket.connect (remote, 50); connected = true; return blocking;
if (connectionPending) throw new ConnectionPendingException(); if (!(remote instanceof InetSocketAddress)) throw new UnsupportedAddressTypeException(); if (((InetSocketAddress) remote).isUnresolved()) throw new UnresolvedAddressException(); if (blocking) { socket.connect (remote); connected = true; return true; } ...
public boolean connect (SocketAddress remote) throws IOException { if (connected) throw new AlreadyConnectedException(); socket.connect (remote, 50); connected = true; return blocking; // FIXME }
if (connected)
if (isConnected())
public void finalizer() { if (connected) { try { close (); } catch (Exception e) { } } }
if (!isOpen()) throw new ClosedChannelException(); if (!connectionPending) throw new NoConnectionPendingException(); if (isConnected()) return true; Selector selector = provider().openSelector(); register (selector, SelectionKey.OP_CONNECT); if (isBlocking()) { selector.select(); connected = true; connectionPendi...
public boolean finishConnect () { return false; }
return blocking ? true : false;
return connectionPending;
public boolean isConnectionPending () { return blocking ? true : false; }
int bytes = 0; int len = dst.remaining ();
int offset = 0; int len = dst.remaining();
public int read (ByteBuffer dst) throws IOException { byte[] data; int bytes = 0; int len = dst.remaining (); if (!dst.hasArray ()) { data = new byte [len]; dst.get (data, 0, len); } else { data = dst.array (); } return socket.getInputStream().read (dat...
if (!dst.hasArray ())
if (dst.hasArray())
public int read (ByteBuffer dst) throws IOException { byte[] data; int bytes = 0; int len = dst.remaining (); if (!dst.hasArray ()) { data = new byte [len]; dst.get (data, 0, len); } else { data = dst.array (); } return socket.getInputStream().read (dat...
data = new byte [len]; dst.get (data, 0, len);
offset = dst.arrayOffset() + dst.position(); data = dst.array();
public int read (ByteBuffer dst) throws IOException { byte[] data; int bytes = 0; int len = dst.remaining (); if (!dst.hasArray ()) { data = new byte [len]; dst.get (data, 0, len); } else { data = dst.array (); } return socket.getInputStream().read (dat...
data = dst.array ();
data = new byte [len];
public int read (ByteBuffer dst) throws IOException { byte[] data; int bytes = 0; int len = dst.remaining (); if (!dst.hasArray ()) { data = new byte [len]; dst.get (data, 0, len); } else { data = dst.array (); } return socket.getInputStream().read (dat...
return socket.getInputStream().read (data, 0, len);
if (len > available) len = available; int readBytes = 0; boolean completed = false; try { begin(); readBytes = input.read (data, offset, len); completed = true; } finally { end (completed); } if (readBytes > 0 && !dst.hasArray()) { dst.put (data); } return readBytes;
public int read (ByteBuffer dst) throws IOException { byte[] data; int bytes = 0; int len = dst.remaining (); if (!dst.hasArray ()) { data = new byte [len]; dst.get (data, 0, len); } else { data = dst.array (); } return socket.getInputStream().read (dat...
int bytes = 0; int len = src.remaining ();
int offset = 0; int len = src.remaining();
public int write (ByteBuffer src) throws IOException { byte[] data; int bytes = 0; int len = src.remaining (); if (!src.hasArray ()) { data = new byte [len]; src.get (data, 0, len); } else { data = src.array (); } socket.getOutputStream().write (da...
data = src.array ();
offset = src.arrayOffset() + src.position(); data = src.array();
public int write (ByteBuffer src) throws IOException { byte[] data; int bytes = 0; int len = src.remaining (); if (!src.hasArray ()) { data = new byte [len]; src.get (data, 0, len); } else { data = src.array (); } socket.getOutputStream().write (da...
socket.getOutputStream().write (data, 0, len);
System.out.println ("INTERNAL: writing to socket outputstream"); OutputStream output = socket.getOutputStream(); output.write (data, offset, len);
public int write (ByteBuffer src) throws IOException { byte[] data; int bytes = 0; int len = src.remaining (); if (!src.hasArray ()) { data = new byte [len]; src.get (data, 0, len); } else { data = src.array (); } socket.getOutputStream().write (da...
clazz = classFromEntity(EOModelGroup.defaultGroup().entityNamed(entityName));
clazz = classFromEntity(ERXEOAccessUtilities.entityNamed(null, entityName));
public static EOGenericRecordClazz clazzForEntityNamed(String entityName) { EOGenericRecordClazz clazz = (EOGenericRecordClazz)allClazzes.objectForKey(entityName); if(clazz == null) { clazz = classFromEntity(EOModelGroup.defaultGroup().entityNamed(entityName)); clazz.setEntityNam...
if (_entity == null) _entity = EOModelGroup.defaultGroup().entityNamed(entityName()); return _entity;
return entity(null);
public EOEntity entity() { if (_entity == null) _entity = EOModelGroup.defaultGroup().entityNamed(entityName()); return _entity; }
return EOModelGroup.defaultGroup().fetchSpecificationNamed(name,entityName());
return fetchSpecificationNamed(null,name);
public EOFetchSpecification fetchSpecificationNamed(String name) { return EOModelGroup.defaultGroup().fetchSpecificationNamed(name,entityName()); }
EODatabaseContext dc = EODatabaseContext.registeredDatabaseContextForModel(entity().model(), ec);
EOEntity entity = entity(ec); EODatabaseContext dc = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), ec);
public NSArray newPrimaryKeys(EOEditingContext ec, int i) { EODatabaseContext dc = EODatabaseContext.registeredDatabaseContextForModel(entity().model(), ec); return dc.availableChannel().adaptorChannel().primaryKeysForNewRowsWithEntity(i, entity()); }
return dc.availableChannel().adaptorChannel().primaryKeysForNewRowsWithEntity(i, entity());
return dc.availableChannel().adaptorChannel().primaryKeysForNewRowsWithEntity(i, entity);
public NSArray newPrimaryKeys(EOEditingContext ec, int i) { EODatabaseContext dc = EODatabaseContext.registeredDatabaseContextForModel(entity().model(), ec); return dc.availableChannel().adaptorChannel().primaryKeysForNewRowsWithEntity(i, entity()); }
public Number objectCountWithFetchSpecificationAndBindings(EOEditingContext editingContext, String fetchSpecName, NSDictionary bindings) {
public Number objectCountWithFetchSpecificationAndBindings(EOEditingContext ec, String fetchSpecName, NSDictionary bindings) {
public Number objectCountWithFetchSpecificationAndBindings(EOEditingContext editingContext, String fetchSpecName, NSDictionary bindings) { String entityName = entityName(); EOFetchSpecification unboundFetchSpec; EOFetchSpecification boundFetchSpec; unboundFetchSpec = fetchSpecificationN...
unboundFetchSpec = fetchSpecificationNamed(fetchSpecName);
unboundFetchSpec = fetchSpecificationNamed(ec, fetchSpecName);
public Number objectCountWithFetchSpecificationAndBindings(EOEditingContext editingContext, String fetchSpecName, NSDictionary bindings) { String entityName = entityName(); EOFetchSpecification unboundFetchSpec; EOFetchSpecification boundFetchSpec; unboundFetchSpec = fetchSpecificationN...
return objectCountWithQualifier(editingContext, boundFetchSpec.qualifier());
return objectCountWithQualifier(ec, boundFetchSpec.qualifier());
public Number objectCountWithFetchSpecificationAndBindings(EOEditingContext editingContext, String fetchSpecName, NSDictionary bindings) { String entityName = entityName(); EOFetchSpecification unboundFetchSpec; EOFetchSpecification boundFetchSpec; unboundFetchSpec = fetchSpecificationN...
EOEntity entity = entity();
EOEntity entity = entity(ec);
public Number objectCountWithQualifier(EOEditingContext ec, EOQualifier qualifier) { String entityName = entityName(); NSArray results = null; EOAttribute attribute = EOGenericRecordClazz.objectCountAttribute(); EOEntity entity = entity(); EOQualifier schemaBasedQualifier ...
return EOUtilities.objectFromRawRow(ec, entityNameForRawRow(dict), dict);
return EOUtilities.objectFromRawRow(ec, entityNameFromRawRow(ec, dict), dict);
public EOEnterpriseObject objectFromRawRow(EOEditingContext ec, NSDictionary dict) { return EOUtilities.objectFromRawRow(ec, entityNameForRawRow(dict), dict); }
NSMutableArray keys = new NSMutableArray(entity().primaryKeyAttributeNames());
EOEntity entity = entity(ec); NSMutableArray keys = new NSMutableArray(entity.primaryKeyAttributeNames());
public EOFetchSpecification primaryKeyFetchSpecificationForEntity(EOEditingContext ec, EOQualifier eoqualifier, NSArray sortOrderings, NSArray additionalKeys) { String entityName = entityName(); EOFetchSpecification fs = new EOFetchSpecification(entityName, eoqualifier, sortOrderings); fs.setFe...
if(entity().restrictingQualifier() != null) { NSArray restrict = entity().restrictingQualifier().allQualifierKeys().allObjects();
if(entity.restrictingQualifier() != null) { NSArray restrict = entity.restrictingQualifier().allQualifierKeys().allObjects();
public EOFetchSpecification primaryKeyFetchSpecificationForEntity(EOEditingContext ec, EOQualifier eoqualifier, NSArray sortOrderings, NSArray additionalKeys) { String entityName = entityName(); EOFetchSpecification fs = new EOFetchSpecification(entityName, eoqualifier, sortOrderings); fs.setFe...
if(entity().isAbstractEntity()) { NSArray restrict = (NSArray)entity().subEntities().valueForKeyPath("restrictingQualifier.allQualifierKeys.allObjects.@flatten.@unique");
if(entity.isAbstractEntity()) { NSArray restrict = (NSArray)entity.subEntities().valueForKeyPath("restrictingQualifier.allQualifierKeys.allObjects.@flatten.@unique");
public EOFetchSpecification primaryKeyFetchSpecificationForEntity(EOEditingContext ec, EOQualifier eoqualifier, NSArray sortOrderings, NSArray additionalKeys) { String entityName = entityName(); EOFetchSpecification fs = new EOFetchSpecification(entityName, eoqualifier, sortOrderings); fs.setFe...
t.group = null;
final synchronized void removeThread(Thread t) { if (groups == null) return; threads.remove(t); // Daemon groups are automatically destroyed when all their threads die. if (daemon_flag && groups.size() == 0 && threads.size() == 0) { // We inline destroy to avoid the access check. ...
UnitPrefix unitPrefix = UnitPrefix.findAppropiatePrefix(number, unitPrefixArray);
UnitPrefix unitPrefix = UnitPrefix.findAppropriatePrefix(number, unitPrefixArray);
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition fieldPosition) { StringBuffer result = toAppendTo; UnitPrefix unitPrefix = UnitPrefix.findAppropiatePrefix(number, unitPrefixArray); if (unitPrefix == null) { result = super.format(number, toAppendTo, fi...
file = file.substring(0, lastSlash) + '/' + spec.substring(start, end);
if (lastSlash < 0) file = spec.substring(start, end); else file = (file.substring(0, lastSlash) + '/' + spec.substring(start, end));
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); String userInfo = url.getUserInfo(); String authority = url.getAuthority(); String query = null; // On Windows...
if (arrays.length == 0) { throw new IllegalArgumentException("No arrays specified to sort"); } for (int i = 0; i < array.length; i++) { if (!arrays[i].getClass().isArray()) { throw new IllegalArgumentException(arrays[i].getClass() + " is not an array"); } }
public void generateClass(ClassVisitor v) throws Exception { new ParallelSorterEmitter(v, getClassName(), arrays); }
element.setAttribute(NAME_ATTR, data.getName());
if(element != null) { if(data != null && data.getName() != null) { element.setAttribute(NAME_ATTR, data.getName()); } else { element.setAttribute(NAME_ATTR, ""); } }
private void addChildToDocument(Document doc, ComponentData data, Element parent) { Element element = null; if(data.getType().equals(ComponentData.HOST)) { element = doc.createElement(HOST_NODE); } else if(data.getType().equals(ComponentData.NODE)) { element = doc.createElement(NODE_NODE); } els...
for (int j = 0; j < nodes.size(); j++) { String node = (String)nodes.get(j); if (findListener(appServerDesc.appServer, node) == null) unattachedNodes.add(node);
if (nodes != null) { for (Iterator j = nodes.iterator(); j.hasNext(); ) { ProcessDescription pd = (ProcessDescription)j.next(); String name = pd.getName(); if (findListener(appServerDesc.appServer, name) == null) unattachedNodes.add(name); }
public ArrayList getUnattachedNodes() { ArrayList unattachedNodes = new ArrayList(); ArrayList appServers = model.getAppServers(); for (int i = 0; i < appServers.size(); i++) { AppServerDesc appServerDesc = (AppServerDesc)appServers.get(i); List nodes = getNodesOfAppServer(appServerDesc.appServer);...
log.debug(data + " already has plugin " + self);
log.debug(data + " already has binder " + self);
public ComponentData addComponentData(ComponentData data) { // Warning: This assumes it has been handed the component in // which to add itself if (data.getType() != ComponentData.AGENT && data.getType() != ComponentData.NODE) { if (log.isErrorEnabled()) { log.error("Asked to add to non Agent/Node: " + ...
return (String)BG_COLORS.objectForKey(ERXConstant.integerForInt(categoryPriorityValue()));
return (String)BG_COLORS.objectForKey(categoryPriorityValue());
public String bgColor() { return (String)BG_COLORS.objectForKey(ERXConstant.integerForInt(categoryPriorityValue())); }
public int categoryPriorityValue() { return category()!=null && category().getPriority()!=null ? category().getPriority().toInt() : -1;
public Integer categoryPriorityValue() { return category()!=null && category().getPriority()!=null ? ERXConstant.integerForInt(category().getPriority().toInt()) : ERXConstant.MinusOneInteger;
public int categoryPriorityValue() { return category()!=null && category().getPriority()!=null ? category().getPriority().toInt() : -1; }
public void setCategoryPriorityValue(String newValue) { int pr=Integer.parseInt(newValue);
public void setCategoryPriorityValue(Integer newValue) { int pr=newValue!=null ? newValue.intValue() : -1;
public void setCategoryPriorityValue(String newValue) { int pr=Integer.parseInt(newValue); category().setPriority(pr!=-1 ? Priority.toPriority(pr) : null); }
if(objects != null) {
if(objects == null || objects.count() == 0) {
private NSDictionary snapshotsGroupedByEntity(NSArray objects, EOObjectStoreCoordinator osc) { if(objects != null) { return NSDictionary.EmptyDictionary; } NSMutableDictionary result = new NSMutableDictionary(); NSMutableDictionary dbcs = ne...
log.info("forget: " + globalID);
public void processSnapshotForGlobalID(EODatabaseContext database, NSDictionary snapshot, EOGlobalID globalID) { database.forgetSnapshotForGlobalID(globalID); }
}
log.info("insert: " + globalID); }
public void processSnapshotForGlobalID(EODatabaseContext database, NSDictionary snapshot, EOGlobalID globalID) { database.recordSnapshotForGlobalID(snapshot, globalID); }
}
log.info("update: " + globalID); }
public void processSnapshotForGlobalID(EODatabaseContext database, NSDictionary snapshot, EOGlobalID globalID) { database.forgetSnapshotForGlobalID(globalID); database.recordSnapshotForGlobalID(snapshot, globalID); }
notify();
_elements.notify();
private void addChange(Change changes) { synchronized (_elements) { _elements.add(changes); notify(); } }
try { if(_elements.isEmpty()) { wait(10);
Change changes = null; synchronized(_elements) { try { if(_elements.isEmpty()) { _elements.wait(); } if(!_elements.isEmpty()) { changes = (Change)_elements.remove(0); } } catch (InterruptedException e) { run = false; log.info("Interrupted: " + e, e);
public void run() { boolean run = true; while (true) { try { if(_elements.isEmpty()) { wait(10); } } catch (InterruptedException e) { run = false; log.info("Inte...
} catch (InterruptedException e) { run = false; log.info("Interrupted: " + e, e);
public void run() { boolean run = true; while (true) { try { if(_elements.isEmpty()) { wait(10); } } catch (InterruptedException e) { run = false; log.info("Inte...
if (!_elements.isEmpty()) { Change changes = null; synchronized(_elements) { changes = (Change)_elements.remove(0); }
if(changes != null) {
public void run() { boolean run = true; while (true) { try { if(_elements.isEmpty()) { wait(10); } } catch (InterruptedException e) { run = false; log.info("Inte...
_coordinators.addObject(osc); NSSelector sel = new NSSelector("publishChange", new Class[] { NSNotification.class } ); NSNotificationCenter.defaultCenter().addObserver(this, sel, EOObjectStoreCoordinator.ObjectsChangedInStoreNotification, osc);
if(!_coordinators.containsObject(osc)) { _coordinators.addObject(osc); NSSelector sel = new NSSelector("publishChange", new Class[] { NSNotification.class } ); NSNotificationCenter.defaultCenter().addObserver(this, sel, EOObjectStoreCoordinator.ObjectsChangedInStoreNotification, osc); } else { log.error("Adding same co...
public void addObjectStore(EOObjectStoreCoordinator osc) { _coordinators.addObject(osc); NSSelector sel = new NSSelector("publishChange", new Class[] { NSNotification.class } ); NSNotificationCenter.defaultCenter().addObserver(this, sel, EOObjectStoreCoordinator.ObjectsChangedInStoreNot...
_coordinators.removeObject(osc); NSNotificationCenter.defaultCenter().removeObserver(this, EOObjectStoreCoordinator.ObjectsChangedInStoreNotification, osc);
if(_coordinators.containsObject(osc)) { _coordinators.removeObject(osc); NSNotificationCenter.defaultCenter().removeObserver(this, EOObjectStoreCoordinator.ObjectsChangedInStoreNotification, osc); } else { log.error("Coordinator not found!"); }
public void removeObjectStore(EOObjectStoreCoordinator osc) { _coordinators.removeObject(osc); NSNotificationCenter.defaultCenter().removeObserver(this, EOObjectStoreCoordinator.ObjectsChangedInStoreNotification, osc); }
public ERXObjectStoreCoordinatorSynchronizer synchronizer() {
public static ERXObjectStoreCoordinatorSynchronizer synchronizer() {
public ERXObjectStoreCoordinatorSynchronizer synchronizer() { if(_synchronizer == null) { initialize(); } return _synchronizer; }
return(pItems.size());
return countItems ();
getItemCount(){ return(pItems.size());}