rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
throw new InvalidContextException(warning);
throw new ContextException(warning);
final Object getValue(Context context) throws InvalidContextException { try { return context.getTool(_names); } catch (Exception e) { Engine.log.exception(e); String warning = "Variable: unable to access " + this + ";"; throw new InvalidContextException(warning); } }
throws InvalidContextException
throws ContextException
final void setValue(Context context, Object newValue) throws InvalidContextException { try{ if (!context.setTool(_names,newValue)) { throw new InvalidContextException("No method to set \"" + _vname + "\" to type " + ((newValue == null) ? "null" : newValue.getClass().toString()) + " in supplied context (" + context.getClass() + ")"); } } catch (Exception e) { Engine.log.exception(e); String warning = "Variable.setValue: unable to access " + this + " (is it a public method/field?)"; throw new InvalidContextException(warning); } }
throw new InvalidContextException("No method to set \"" + _vname +
throw new ContextException("No method to set \"" + _vname +
final void setValue(Context context, Object newValue) throws InvalidContextException { try{ if (!context.setTool(_names,newValue)) { throw new InvalidContextException("No method to set \"" + _vname + "\" to type " + ((newValue == null) ? "null" : newValue.getClass().toString()) + " in supplied context (" + context.getClass() + ")"); } } catch (Exception e) { Engine.log.exception(e); String warning = "Variable.setValue: unable to access " + this + " (is it a public method/field?)"; throw new InvalidContextException(warning); } }
throw new InvalidContextException(warning);
throw new ContextException(warning);
final void setValue(Context context, Object newValue) throws InvalidContextException { try{ if (!context.setTool(_names,newValue)) { throw new InvalidContextException("No method to set \"" + _vname + "\" to type " + ((newValue == null) ? "null" : newValue.getClass().toString()) + " in supplied context (" + context.getClass() + ")"); } } catch (Exception e) { Engine.log.exception(e); String warning = "Variable.setValue: unable to access " + this + " (is it a public method/field?)"; throw new InvalidContextException(warning); } }
note.getParent().removeNote(note);
note.getHolder().removeNote(note);
public void deleteSelfAndChildren() { for (DisplayedNote child : children) { child.deleteSelfAndChildren(); } treeNode.dispose(); if (tab != null) tab.dispose(); note.getParent().removeNote(note); }
String name = pType;
public void addProvider(Provider p, String pType) throws InitException { String name = pType; if (pType == null || pType.equals("")) pType = p.getType(); p.init(this, _config); _providers.put(pType, p); _log.info("Loaded provider " + p); if (!pType.equals(p.getType())) _log.info("Provider name remapped from " + p.getType() + " to " + pType); }
workspacePane.setActiveButtonBold(true); cardLayout = new CardLayout(); cardPanel = new JPanel(cardLayout); cardPanel.setOpaque(false); cardPanel.add(WORKSPACE_PANE, workspacePane);
private Workspace() { MainWindow mainWindow = SparkManager.getMainWindow(); // Add MainWindow listener mainWindow.addMainWindowListener(new MainWindowListener() { public void shutdown() { // Close all Chats. final Iterator chatRooms = SparkManager.getChatManager().getChatContainer().getAllChatRooms(); while (chatRooms.hasNext()) { final ChatRoom chatRoom = (ChatRoom)chatRooms.next(); // Leave ChatRoom SparkManager.getChatManager().getChatContainer().leaveChatRoom(chatRoom); } conferences.shutdown(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); // Initialize workspace pane, defaulting the tabs to the bottom. workspacePane = new SparkTabbedPane(JTabbedPane.BOTTOM); //workspacePane.setBoldActiveTab(true); //workspacePane.setHideOneTab(true); // Build default workspace this.setLayout(new GridBagLayout()); add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0)); add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0)); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F12"), "showDebugger"); this.getActionMap().put("showDebugger", new AbstractAction("showDebugger") { public void actionPerformed(ActionEvent evt) { EnhancedDebuggerWindow window = EnhancedDebuggerWindow.getInstance(); window.setVisible(true); } }); // Set background Color menuBarColor = new Color(235, 233, 237); setBackground(menuBarColor); workspacePane.setActiveButtonBold(true); }
add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));
add(cardPanel, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));
private Workspace() { MainWindow mainWindow = SparkManager.getMainWindow(); // Add MainWindow listener mainWindow.addMainWindowListener(new MainWindowListener() { public void shutdown() { // Close all Chats. final Iterator chatRooms = SparkManager.getChatManager().getChatContainer().getAllChatRooms(); while (chatRooms.hasNext()) { final ChatRoom chatRoom = (ChatRoom)chatRooms.next(); // Leave ChatRoom SparkManager.getChatManager().getChatContainer().leaveChatRoom(chatRoom); } conferences.shutdown(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); // Initialize workspace pane, defaulting the tabs to the bottom. workspacePane = new SparkTabbedPane(JTabbedPane.BOTTOM); //workspacePane.setBoldActiveTab(true); //workspacePane.setHideOneTab(true); // Build default workspace this.setLayout(new GridBagLayout()); add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0)); add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0)); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F12"), "showDebugger"); this.getActionMap().put("showDebugger", new AbstractAction("showDebugger") { public void actionPerformed(ActionEvent evt) { EnhancedDebuggerWindow window = EnhancedDebuggerWindow.getInstance(); window.setVisible(true); } }); // Set background Color menuBarColor = new Color(235, 233, 237); setBackground(menuBarColor); workspacePane.setActiveButtonBold(true); }
workspacePane.setActiveButtonBold(true);
private Workspace() { MainWindow mainWindow = SparkManager.getMainWindow(); // Add MainWindow listener mainWindow.addMainWindowListener(new MainWindowListener() { public void shutdown() { // Close all Chats. final Iterator chatRooms = SparkManager.getChatManager().getChatContainer().getAllChatRooms(); while (chatRooms.hasNext()) { final ChatRoom chatRoom = (ChatRoom)chatRooms.next(); // Leave ChatRoom SparkManager.getChatManager().getChatContainer().leaveChatRoom(chatRoom); } conferences.shutdown(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); // Initialize workspace pane, defaulting the tabs to the bottom. workspacePane = new SparkTabbedPane(JTabbedPane.BOTTOM); //workspacePane.setBoldActiveTab(true); //workspacePane.setHideOneTab(true); // Build default workspace this.setLayout(new GridBagLayout()); add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0)); add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0)); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F12"), "showDebugger"); this.getActionMap().put("showDebugger", new AbstractAction("showDebugger") { public void actionPerformed(ActionEvent evt) { EnhancedDebuggerWindow window = EnhancedDebuggerWindow.getInstance(); window.setVisible(true); } }); // Set background Color menuBarColor = new Color(235, 233, 237); setBackground(menuBarColor); workspacePane.setActiveButtonBold(true); }
if ((0xa7ffe06000000000L & l) == 0L)
if ((0xa7ffec6000000000L & l) == 0L)
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 53; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 10: case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 17) kind = 17; jjCheckNAdd(9); break; case 14: case 13: if ((0x3ff600000000000L & l) != 0L) jjCheckNAddTwoStates(13, 14); break; case 54: case 1: jjCheckNAddStates(0, 2); break; case 7: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 34) kind = 34; } else if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(3, 6); if ((0x3ff600000000000L & l) != 0L) jjCheckNAddTwoStates(13, 14); else if ((0x100000200L & l) != 0L) { if (kind > 29) kind = 29; } else if (curChar == 13) jjCheckNAddStates(7, 9); else if (curChar == 10) { if (kind > 27) kind = 27; jjCheckNAddStates(10, 14); } if ((0x3ff000000000000L & l) != 0L) { if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); } else if (curChar == 32) jjstateSet[jjnewStateCnt++] = 20; break; case 53: jjCheckNAddStates(0, 2); break; case 3: jjCheckNAddStates(18, 20); break; case 6: jjCheckNAddStates(21, 24); break; case 11: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 18) kind = 18; jjstateSet[jjnewStateCnt++] = 11; break; case 15: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(15, 16); break; case 16: if (curChar == 46) jjstateSet[jjnewStateCnt++] = 17; break; case 17: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(18); break; case 18: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(25, 27); break; case 19: if (curChar == 32) jjstateSet[jjnewStateCnt++] = 20; break; case 20: if (curChar == 32 && kind > 28) kind = 28; break; case 21: if ((0x100000200L & l) != 0L && kind > 29) kind = 29; break; case 22: if ((0xfc00ffffffffffffL & l) != 0L && kind > 34) kind = 34; break; case 23: if (curChar != 10) break; if (kind > 27) kind = 27; jjCheckNAddStates(10, 14); break; case 24: case 25: if (curChar == 10) jjCheckNAddStates(28, 30); break; case 26: if (curChar == 13) jjCheckNAdd(25); break; case 27: if (curChar == 45) jjCheckNAdd(28); break; case 28: if ((0x100000200L & l) == 0L) break; if (kind > 16) kind = 16; jjCheckNAdd(28); break; case 29: case 30: if (curChar == 10 && kind > 26) kind = 26; break; case 31: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 30; break; case 32: if (curChar == 13) jjCheckNAddStates(7, 9); break; case 33: if (curChar == 10) jjCheckNAddTwoStates(29, 31); break; case 34: if (curChar == 10 && kind > 27) kind = 27; break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); break; case 36: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(36, 37); break; case 37: if (curChar == 58) jjstateSet[jjnewStateCnt++] = 38; break; case 38: if ((0xa7ffe06000000000L & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAddStates(31, 33); break; case 39: if ((0xa7ffe06000000000L & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAdd(39); break; case 40: if ((0xa7ffe06000000000L & l) != 0L) jjCheckNAddTwoStates(40, 41); break; case 41: if (curChar == 40) jjCheckNAdd(42); break; case 42: if ((0xfffffdffffffdbffL & l) != 0L) jjCheckNAddTwoStates(42, 43); break; case 43: if (curChar == 41 && kind > 22) kind = 22; break; case 44: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAdd(44); break; case 45: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(3, 6); break; case 46: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(46, 47); break; case 47: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddTwoStates(47, 48); break; case 48: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(34, 36); break; case 49: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(49, 50); break; case 50: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(37, 39); break; case 52: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(40, 43); break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 10: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 17) kind = 17; jjCheckNAdd(9); } else if (curChar == 64) { if (kind > 18) kind = 18; jjCheckNAdd(11); } break; case 14: if ((0x7fffffe87fffffeL & l) != 0L) jjCheckNAddTwoStates(13, 14); else if (curChar == 64) jjCheckNAdd(15); break; case 54: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(0, 2); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 7: if ((0x7fffffe87fffffeL & l) != 0L) jjCheckNAddTwoStates(13, 14); else if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; else if (curChar == 91) jjstateSet[jjnewStateCnt++] = 0; if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); } else if ((0xf8000001f8000001L & l) != 0L) { if (kind > 34) kind = 34; } if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(3, 6); else if (curChar == 94) jjCheckNAdd(9); break; case 53: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(0, 2); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 0: if (curChar == 91) jjCheckNAddTwoStates(1, 2); break; case 1: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; case 2: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(18, 20); break; case 4: if (curChar == 93 && kind > 10) kind = 10; break; case 5: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; break; case 6: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(21, 24); break; case 8: if (curChar == 94) jjCheckNAdd(9); break; case 9: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 17) kind = 17; jjCheckNAdd(9); break; case 11: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 18) kind = 18; jjCheckNAdd(11); break; case 12: if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; break; case 13: if ((0x7fffffe87fffffeL & l) != 0L) jjCheckNAddTwoStates(13, 14); break; case 15: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(15, 16); break; case 17: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(18); break; case 18: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(25, 27); break; case 22: if ((0xf8000001f8000001L & l) != 0L && kind > 34) kind = 34; break; case 35: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); break; case 36: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(36, 37); break; case 38: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAddStates(31, 33); break; case 39: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAdd(39); break; case 40: if ((0x47fffffe87ffffffL & l) != 0L) jjCheckNAddTwoStates(40, 41); break; case 42: jjAddStates(44, 45); break; case 44: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAdd(44); break; case 45: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(3, 6); break; case 46: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(46, 47); break; case 47: if ((0x7fffffe00000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddTwoStates(47, 48); break; case 48: if ((0x7fffffeL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(34, 36); break; case 49: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(49, 50); break; case 50: if ((0x7fffffe00000000L & l) != 0L) jjCheckNAddStates(37, 39); break; case 51: if (curChar == 96 && kind > 24) kind = 24; break; case 52: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(40, 43); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 54: case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(0, 2); break; case 7: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 34) kind = 34; break; case 53: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(0, 2); break; case 3: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(18, 20); break; case 6: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(21, 24); break; case 42: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjAddStates(44, 45); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 53 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
if ((0xa7ffe06000000000L & l) != 0L)
if ((0xa7ffec6000000000L & l) != 0L)
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 53; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 10: case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 17) kind = 17; jjCheckNAdd(9); break; case 14: case 13: if ((0x3ff600000000000L & l) != 0L) jjCheckNAddTwoStates(13, 14); break; case 54: case 1: jjCheckNAddStates(0, 2); break; case 7: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 34) kind = 34; } else if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(3, 6); if ((0x3ff600000000000L & l) != 0L) jjCheckNAddTwoStates(13, 14); else if ((0x100000200L & l) != 0L) { if (kind > 29) kind = 29; } else if (curChar == 13) jjCheckNAddStates(7, 9); else if (curChar == 10) { if (kind > 27) kind = 27; jjCheckNAddStates(10, 14); } if ((0x3ff000000000000L & l) != 0L) { if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); } else if (curChar == 32) jjstateSet[jjnewStateCnt++] = 20; break; case 53: jjCheckNAddStates(0, 2); break; case 3: jjCheckNAddStates(18, 20); break; case 6: jjCheckNAddStates(21, 24); break; case 11: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 18) kind = 18; jjstateSet[jjnewStateCnt++] = 11; break; case 15: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(15, 16); break; case 16: if (curChar == 46) jjstateSet[jjnewStateCnt++] = 17; break; case 17: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(18); break; case 18: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(25, 27); break; case 19: if (curChar == 32) jjstateSet[jjnewStateCnt++] = 20; break; case 20: if (curChar == 32 && kind > 28) kind = 28; break; case 21: if ((0x100000200L & l) != 0L && kind > 29) kind = 29; break; case 22: if ((0xfc00ffffffffffffL & l) != 0L && kind > 34) kind = 34; break; case 23: if (curChar != 10) break; if (kind > 27) kind = 27; jjCheckNAddStates(10, 14); break; case 24: case 25: if (curChar == 10) jjCheckNAddStates(28, 30); break; case 26: if (curChar == 13) jjCheckNAdd(25); break; case 27: if (curChar == 45) jjCheckNAdd(28); break; case 28: if ((0x100000200L & l) == 0L) break; if (kind > 16) kind = 16; jjCheckNAdd(28); break; case 29: case 30: if (curChar == 10 && kind > 26) kind = 26; break; case 31: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 30; break; case 32: if (curChar == 13) jjCheckNAddStates(7, 9); break; case 33: if (curChar == 10) jjCheckNAddTwoStates(29, 31); break; case 34: if (curChar == 10 && kind > 27) kind = 27; break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); break; case 36: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(36, 37); break; case 37: if (curChar == 58) jjstateSet[jjnewStateCnt++] = 38; break; case 38: if ((0xa7ffe06000000000L & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAddStates(31, 33); break; case 39: if ((0xa7ffe06000000000L & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAdd(39); break; case 40: if ((0xa7ffe06000000000L & l) != 0L) jjCheckNAddTwoStates(40, 41); break; case 41: if (curChar == 40) jjCheckNAdd(42); break; case 42: if ((0xfffffdffffffdbffL & l) != 0L) jjCheckNAddTwoStates(42, 43); break; case 43: if (curChar == 41 && kind > 22) kind = 22; break; case 44: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAdd(44); break; case 45: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(3, 6); break; case 46: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(46, 47); break; case 47: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddTwoStates(47, 48); break; case 48: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(34, 36); break; case 49: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(49, 50); break; case 50: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(37, 39); break; case 52: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(40, 43); break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 10: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 17) kind = 17; jjCheckNAdd(9); } else if (curChar == 64) { if (kind > 18) kind = 18; jjCheckNAdd(11); } break; case 14: if ((0x7fffffe87fffffeL & l) != 0L) jjCheckNAddTwoStates(13, 14); else if (curChar == 64) jjCheckNAdd(15); break; case 54: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(0, 2); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 7: if ((0x7fffffe87fffffeL & l) != 0L) jjCheckNAddTwoStates(13, 14); else if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; else if (curChar == 91) jjstateSet[jjnewStateCnt++] = 0; if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); } else if ((0xf8000001f8000001L & l) != 0L) { if (kind > 34) kind = 34; } if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(3, 6); else if (curChar == 94) jjCheckNAdd(9); break; case 53: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(0, 2); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 0: if (curChar == 91) jjCheckNAddTwoStates(1, 2); break; case 1: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(0, 2); break; case 2: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(18, 20); break; case 4: if (curChar == 93 && kind > 10) kind = 10; break; case 5: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; break; case 6: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(21, 24); break; case 8: if (curChar == 94) jjCheckNAdd(9); break; case 9: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 17) kind = 17; jjCheckNAdd(9); break; case 11: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 18) kind = 18; jjCheckNAdd(11); break; case 12: if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; break; case 13: if ((0x7fffffe87fffffeL & l) != 0L) jjCheckNAddTwoStates(13, 14); break; case 15: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(15, 16); break; case 17: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(18); break; case 18: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(25, 27); break; case 22: if ((0xf8000001f8000001L & l) != 0L && kind > 34) kind = 34; break; case 35: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAddStates(15, 17); break; case 36: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(36, 37); break; case 38: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAddStates(31, 33); break; case 39: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAdd(39); break; case 40: if ((0x47fffffe87ffffffL & l) != 0L) jjCheckNAddTwoStates(40, 41); break; case 42: jjAddStates(44, 45); break; case 44: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 25) kind = 25; jjCheckNAdd(44); break; case 45: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(3, 6); break; case 46: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(46, 47); break; case 47: if ((0x7fffffe00000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddTwoStates(47, 48); break; case 48: if ((0x7fffffeL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(34, 36); break; case 49: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(49, 50); break; case 50: if ((0x7fffffe00000000L & l) != 0L) jjCheckNAddStates(37, 39); break; case 51: if (curChar == 96 && kind > 24) kind = 24; break; case 52: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(40, 43); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 54: case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(0, 2); break; case 7: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 34) kind = 34; break; case 53: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(0, 2); break; case 3: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(18, 20); break; case 6: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(21, 24); break; case 42: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjAddStates(44, 45); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 53 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
ForUpdate();
forUpdate();
final private void ForStatement() throws ParseException { jj_consume_token(FOR); jj_consume_token(LPAREN); switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ASSERT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FINAL: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case SUPER: case THIS: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: ForInit(); break; default: jj_la1[118] = jj_gen; } jj_consume_token(SEMICOLON); switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ASSERT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case SUPER: case THIS: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_la1[119] = jj_gen; } jj_consume_token(SEMICOLON); switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ASSERT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case SUPER: case THIS: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: ForUpdate(); break; default: jj_la1[120] = jj_gen; } jj_consume_token(RPAREN); Statement(); }
_sFunction = "." + new String(getToken(1).image);
_sFunction = "." + getToken(1).image;
final private void MethodDeclarator() throws ParseException { _sFunction = "." + new String(getToken(1).image); Identifier(); FormalParameters(); _sFunction += _sParameter; label_20: while (true) { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case LBRACKET: break; default: jj_la1[45] = jj_gen; break label_20; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); _sFunction += "[]"; } }
_sName = new String(getToken(0).image);
_sName = getToken(0).image;
final private void Name() throws ParseException { Identifier(); _sName = new String(getToken(0).image); label_25: while (true) { if (jj_2_15(2)) { } else { break label_25; } jj_consume_token(DOT); Identifier(); _sName += "." + (new String(getToken(0).image)); } }
_sName += "." + (new String(getToken(0).image));
_sName += "." + getToken(0).image;
final private void Name() throws ParseException { Identifier(); _sName = new String(getToken(0).image); label_25: while (true) { if (jj_2_15(2)) { } else { break label_25; } jj_consume_token(DOT); Identifier(); _sName += "." + (new String(getToken(0).image)); } }
_sPackage = (new String(_sName)) + ".";
_sPackage = _sName + ".";
final private void PackageDeclaration() throws ParseException { jj_consume_token(PACKAGE); Name(); jj_consume_token(SEMICOLON); getToken(0); getToken(0); _sPackage = (new String(_sName)) + "."; }
BreakStatement();
breakStatement();
final private void Statement() throws ParseException { _bReturn = false; if (jj_2_34(2)) { LabeledStatement(); } else { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; default: jj_la1[104] = jj_gen; if (jj_2_35(2147483647)) { AssertStatement(); } else { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ASSERT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case SUPER: case THIS: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); _cyc++; break; case WHILE: WhileStatement(); _cyc++; break; case DO: DoStatement(); _cyc++; break; case FOR: ForStatement(); _cyc++; break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case THROW: ThrowStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case TRY: TryStatement(); break; default: jj_la1[105] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } } }
ContinueStatement();
continueStatement();
final private void Statement() throws ParseException { _bReturn = false; if (jj_2_34(2)) { LabeledStatement(); } else { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; default: jj_la1[104] = jj_gen; if (jj_2_35(2147483647)) { AssertStatement(); } else { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ASSERT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case SUPER: case THIS: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); _cyc++; break; case WHILE: WhileStatement(); _cyc++; break; case DO: DoStatement(); _cyc++; break; case FOR: ForStatement(); _cyc++; break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case THROW: ThrowStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case TRY: TryStatement(); break; default: jj_la1[105] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } } }
ReturnStatement();
returnStatement();
final private void Statement() throws ParseException { _bReturn = false; if (jj_2_34(2)) { LabeledStatement(); } else { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; default: jj_la1[104] = jj_gen; if (jj_2_35(2147483647)) { AssertStatement(); } else { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ASSERT: case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FALSE: case FLOAT: case INT: case LONG: case NEW: case NULL: case SHORT: case SUPER: case THIS: case TRUE: case VOID: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); _cyc++; break; case WHILE: WhileStatement(); _cyc++; break; case DO: DoStatement(); _cyc++; break; case FOR: ForStatement(); _cyc++; break; case BREAK: BreakStatement(); break; case CONTINUE: ContinueStatement(); break; case RETURN: ReturnStatement(); break; case THROW: ThrowStatement(); break; case SYNCHRONIZED: SynchronizedStatement(); break; case TRY: TryStatement(); break; default: jj_la1[105] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } } }
_sName = (new String(getToken(0).image));
_sName = getToken(0).image;
final private void Type() throws ParseException { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: PrimitiveType(); _sName = (new String(getToken(0).image)); break; case ASSERT: case IDENTIFIER: Name(); break; default: jj_la1[55] = jj_gen; jj_consume_token(-1); throw new ParseException(); } label_23: while (true) { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case LBRACKET: break; default: jj_la1[56] = jj_gen; break label_23; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); _sName += "[]"; } }
_sClass += new String(getToken(2).image);
_sClass += getToken(2).image;
final private void UnmodifiedClassDeclaration() throws ParseException { String sOldClass = _sClass; int oldFunctions = _functions; if (!_sClass.equals("")) { _sClass += "."; } _sClass += new String(getToken(2).image); jj_consume_token(CLASS); Identifier(); switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); Name(); break; default: jj_la1[16] = jj_gen; } switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case IMPLEMENTS: jj_consume_token(IMPLEMENTS); NameList(); break; default: jj_la1[17] = jj_gen; } ClassBody(); _functions = oldFunctions; _sClass = sOldClass; }
_sClass += new String(getToken(2).image);
_sClass += getToken(2).image;
final private void UnmodifiedInterfaceDeclaration() throws ParseException { String sOldClass = _sClass; int oldFunctions = _functions; if (!_sClass.equals("")) { _sClass += "."; } _sClass += new String(getToken(2).image); jj_consume_token(INTERFACE); Identifier(); switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); NameList(); break; default: jj_la1[29] = jj_gen; } jj_consume_token(LBRACE); label_14: while (true) { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ABSTRACT: case ASSERT: case BOOLEAN: case BYTE: case CHAR: case CLASS: case DOUBLE: case FINAL: case FLOAT: case INT: case INTERFACE: case LONG: case NATIVE: case PRIVATE: case PROTECTED: case PUBLIC: case SHORT: case STATIC: case TESTAAAA: case SYNCHRONIZED: case TRANSIENT: case VOID: case VOLATILE: case IDENTIFIER: case SEMICOLON: break; default: jj_la1[30] = jj_gen; break label_14; } InterfaceMemberDeclaration(); } jj_consume_token(RBRACE); _functions = oldFunctions; _sClass = sOldClass; }
curChar = input_stream.BeginToken();
curChar = input_stream.beginToken();
public final Token getNextToken() { Token specialToken = null; Token matchedToken; int curPos = 0; EOFLoop: for (;;) { try { curChar = input_stream.BeginToken(); } catch (java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; } image = null; jjimageLen = 0; for (;;) { switch (curLexState) { case 0: try { input_stream.backup(0); while (curChar <= 32 && (0x104003600L & (1L << curChar)) != 0L) curChar = input_stream.BeginToken(); } catch (java.io.IOException e1) { continue EOFLoop; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 9; jjmatchedPos = -1; curPos = 0; curPos = jjMoveStringLiteralDfa0_1(); if (jjmatchedPos < 0 || (jjmatchedPos == 0 && jjmatchedKind > 12)) { jjmatchedKind = 12; jjmatchedPos = 0; } break; case 2: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_2(); if (jjmatchedPos == 0 && jjmatchedKind > 12) { jjmatchedKind = 12; } break; } if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; return matchedToken; } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); if (specialToken == null) specialToken = matchedToken; else { matchedToken.specialToken = specialToken; specialToken = (specialToken.next = matchedToken); } SkipLexicalActions(); } else SkipLexicalActions(); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; continue EOFLoop; } MoreLexicalActions(); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; curPos = 0; jjmatchedKind = 0x7fffffff; try { curChar = input_stream.readChar(); continue; } catch (java.io.IOException e1) { } } int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; } if (!EOFSeen) { input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenMgrError(EOFSeen, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); } } }
error_after = curPos <= 1 ? "" : input_stream.GetImage();
error_after = curPos <= 1 ? "" : input_stream.getImage();
public final Token getNextToken() { Token specialToken = null; Token matchedToken; int curPos = 0; EOFLoop: for (;;) { try { curChar = input_stream.BeginToken(); } catch (java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; } image = null; jjimageLen = 0; for (;;) { switch (curLexState) { case 0: try { input_stream.backup(0); while (curChar <= 32 && (0x104003600L & (1L << curChar)) != 0L) curChar = input_stream.BeginToken(); } catch (java.io.IOException e1) { continue EOFLoop; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 9; jjmatchedPos = -1; curPos = 0; curPos = jjMoveStringLiteralDfa0_1(); if (jjmatchedPos < 0 || (jjmatchedPos == 0 && jjmatchedKind > 12)) { jjmatchedKind = 12; jjmatchedPos = 0; } break; case 2: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_2(); if (jjmatchedPos == 0 && jjmatchedKind > 12) { jjmatchedKind = 12; } break; } if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; return matchedToken; } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); if (specialToken == null) specialToken = matchedToken; else { matchedToken.specialToken = specialToken; specialToken = (specialToken.next = matchedToken); } SkipLexicalActions(); } else SkipLexicalActions(); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; continue EOFLoop; } MoreLexicalActions(); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; curPos = 0; jjmatchedKind = 0x7fffffff; try { curChar = input_stream.readChar(); continue; } catch (java.io.IOException e1) { } } int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; } if (!EOFSeen) { input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenMgrError(EOFSeen, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); } } }
loadTools("Tools");
loadTools("ContextTools");
protected void init () throws InitException { String eehClass; // Initialize the property operator cache _propertyOperators.init(this, _config); // Write out our properties as debug records if (_log.loggingDebug()) { String[] properties = _config.getKeys(); Arrays.sort(properties); for (int i = 0; i < properties.length; i++) { _log.debug("Property " + properties[i] + ": " + _config.getSetting(properties[i])); } } // set up profiling ProfileSystem ps = ProfileSystem.getInstance(); int pRate = _config.getIntegerSetting("Profile.rate", 0); int pTime = _config.getIntegerSetting("Profile.time", 60000); _log.debug("Profiling rate=" + pRate + " time=" + pTime); if ((pRate != 0) && (pTime != 0)) { _prof = ps.newProfileCategory(_name, pRate, pTime); _log.debug("ProfileSystem.newProfileCategory: " + _prof); } else { _prof = null; } if (_prof != null) { _log.notice("Profiling started: " + _prof); } else { _log.info("Profiling not started."); } // set up providers _config.processListSetting("Providers", new ProviderSettingHandler()); if (_providers.size() == 0) { _log.error("No Providers specified"); throw new InitException("No Providers specified in configuration"); } // load tools loadTools("Tools"); loadTools("WebContextTools"); eehClass = _config.getSetting("ExceptionHandler"); if (eehClass != null && !eehClass.equals("")) { try { _eeHandler = (EvaluationExceptionHandler) classForName(eehClass).newInstance(); } catch (Exception e) { _log.warning("Unable to instantiate exception handler of class " + eehClass + "; " + e); } } if (_eeHandler == null) { _eeHandler = new DefaultEvaluationExceptionHandler(); } _eeHandler.init(this, _config); // Initialize function map SubSettings fnSettings = new SubSettings(_config, "Functions"); String[] fns = fnSettings.getKeys(); for (int i = 0; fns != null && i < fns.length; i++) { String fn = fns[i]; String fnSetting = fnSettings.getSetting(fn); int lastDot = fnSetting.lastIndexOf('.'); if (lastDot == -1) { throw new IllegalArgumentException("Bad function declaration for " + fn + ": " + fnSetting + ". This setting must include full class name followed by a '.' and method name"); } String fnClassName = fnSetting.substring(0, lastDot); String fnMethName = fnSetting.substring(lastDot + 1); // function type may be static, instance, or factory. Default is static String fnType = _config.getSetting("Function." + fn + ".type", "static"); Object[] args = null; if ("factory".equals(fnType)) { //TODO: implement this!!! // get function from a factory method // declared class/method is the factory class/instance method // get the factory class method name //String factoryMeth = _config.getSetting("Function." + fn + ".factory.method"); } if (!"static".equals(fnType)) { // get arg string String argString = _config.getSetting("Function." + fn + ".args"); if (argString != null) { if (!argString.startsWith("[")) { argString = "[" + argString + "]"; } org.webmacro.engine.StringTemplate tmpl = new org.webmacro.engine.StringTemplate(this, "#set $args=" + argString); Context argContext = new Context(this); try { tmpl.evaluateAsString(argContext); } catch (Exception e) { _log.error("Unable to evaluate arguments to function " + fn + ". The specified string was " + argString + ".", e); } args = (Object[]) argContext.get("args"); _log.debug("Args for function " + fn + ": " + Arrays.asList(args)); } } Class c = null; try { c = Class.forName(fnClassName); } catch (Exception e) { _log.error("Unable to load class " + fnClassName + " for function " + fn, e); } Object o = c; try { if (c != null) { if ("instance".equals(fnType)) { // instantiate the class o = IntrospectionUtils.instantiate(c, args); } } MethodWrapper mw = new MethodWrapper(o, fnMethName); _functionMap.put(fn, mw); } catch (Exception e) { _log.error("Unable to instantiate the function " + fn + " using the supplied configuration.", e); } } }
}
public static ProjectData getGlobalProjectData() { if (globalProjectData != null) return globalProjectData; File dataFile = CoverageDataFileHandler.getDefaultDataFile(); // Read projectData from the serialized file. if (dataFile.isFile()) { //System.out.println("Cobertura: Loading global project data from " + dataFile.getAbsolutePath()); globalProjectData = CoverageDataFileHandler .loadCoverageData(dataFile); } if (globalProjectData == null) { // We could not read from the serialized file, so create a new object. System.out.println("Cobertura: Coverage data file " + dataFile.getAbsolutePath() + " either does not exist or is not readable. Creating a new data file."); globalProjectData = new ProjectData(); // Add a hook to save the data when the JVM exits saveTimer = new SaveTimer(); Runtime.getRuntime().addShutdownHook(new Thread(saveTimer)); // Possibly also save the coverage data every x seconds? //Timer timer = new Timer(true); //timer.schedule(saveTimer, 100); } return globalProjectData; }
while (o instanceof Macro)
while (o instanceof Macro && o != UndefinedMacro.getInstance())
public Object evaluate (Context context) throws PropertyException { Object o = _object; // evaluate the _object reference down to its base object while (o instanceof Macro) o = ((Macro) o).evaluate(context); if (o == null) { // the Variable to check isn't in the Context. if (_required) { // but it should be throw new PropertyException .NoSuchVariableException(_object.getName()); } else { // but it's not required to be there, so get out now // can't check the type of a null object return null; } } // check it and throw if requried class isn't compatible // with class of specified object if (!_class.isAssignableFrom(o.getClass())) throw new PropertyException.InvalidTypeException(_object.getName(), _class); return null; }
if (o == null)
if (o == null || o == UndefinedMacro.getInstance())
public Object evaluate (Context context) throws PropertyException { Object o = _object; // evaluate the _object reference down to its base object while (o instanceof Macro) o = ((Macro) o).evaluate(context); if (o == null) { // the Variable to check isn't in the Context. if (_required) { // but it should be throw new PropertyException .NoSuchVariableException(_object.getName()); } else { // but it's not required to be there, so get out now // can't check the type of a null object return null; } } // check it and throw if requried class isn't compatible // with class of specified object if (!_class.isAssignableFrom(o.getClass())) throw new PropertyException.InvalidTypeException(_object.getName(), _class); return null; }
Connection conn, String sql, int maxRows) throws SQLException
Connection conn, String sql) throws SQLException
public static ResultSetDataTable create( Connection conn, String sql, int maxRows) throws SQLException { return create(conn, sql, maxRows, 0); }
return create(conn, sql, maxRows, 0);
return create(conn, sql, DEFAULT_MAX_ROWS, 0);
public static ResultSetDataTable create( Connection conn, String sql, int maxRows) throws SQLException { return create(conn, sql, maxRows, 0); }
delegate.parseCustomElement(root, false);
try { try { Method m = BeanDefinitionParserDelegate.class.getMethod("parseCustomElement", new Class[] { Element.class }); m.invoke(delegate, new Object[] { root }); } catch (NoSuchMethodException e) { try { Method m = BeanDefinitionParserDelegate.class.getMethod("parseCustomElement", new Class[] { Element.class, boolean.class }); m.invoke(delegate, new Object[] { root, Boolean.FALSE }); } catch (NoSuchMethodException e2) { throw new IllegalStateException(e); } } } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { if (e.getCause() instanceof RuntimeException) { throw (RuntimeException) e.getCause(); } throw new RuntimeException(e); }
protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) { String namespaceUri = root.getNamespaceURI(); if (!DomUtils.nodeNameEquals(root, "beans") && !delegate.isDefaultNamespace(namespaceUri)) { delegate.parseCustomElement(root, false); } else { super.parseBeanDefinitions(root, delegate); } }
registerEditor("java.util.Date", "org.apache.xbean.spring.context.impl.DateEditor");
public static void registerCustomEditors() { registerEditor("java.io.File", "org.apache.xbean.spring.context.impl.FileEditor"); registerEditor("java.net.URI", "org.apache.xbean.spring.context.impl.URIEditor"); registerEditor("javax.management.ObjectName", "org.apache.xbean.spring.context.impl.ObjectNameEditor"); }
if ((0x87ffe06000000000L & l) == 0L)
if ((0xa7ffe06000000000L & l) == 0L)
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 48; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 10: case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 15) kind = 15; jjCheckNAdd(9); break; case 7: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 32) kind = 32; } else if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(0, 3); if ((0x3ff000000000000L & l) != 0L) { if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); } else if ((0x100000200L & l) != 0L) { if (kind > 27) kind = 27; } else if (curChar == 13) jjAddStates(9, 10); else if (curChar == 10) { if (kind > 25) kind = 25; jjCheckNAddTwoStates(42, 44); } if (curChar == 32) jjstateSet[jjnewStateCnt++] = 14; break; case 49: case 1: jjCheckNAddStates(11, 13); break; case 48: jjCheckNAddStates(11, 13); break; case 3: jjCheckNAddStates(14, 16); break; case 6: jjCheckNAddStates(17, 20); break; case 11: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 16) kind = 16; jjstateSet[jjnewStateCnt++] = 11; break; case 13: if (curChar == 32) jjstateSet[jjnewStateCnt++] = 14; break; case 14: if (curChar == 32 && kind > 26) kind = 26; break; case 15: if ((0x100000200L & l) != 0L && kind > 27) kind = 27; break; case 16: if ((0xfc00ffffffffffffL & l) != 0L && kind > 32) kind = 32; break; case 17: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); break; case 18: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(18, 19); break; case 20: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(20, 21); break; case 21: if (curChar == 46) jjstateSet[jjnewStateCnt++] = 22; break; case 22: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(23); break; case 23: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAddStates(21, 23); break; case 24: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(24, 25); break; case 25: if (curChar == 58) jjstateSet[jjnewStateCnt++] = 26; break; case 26: if ((0x87ffe06000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAddStates(24, 26); break; case 27: if ((0x87ffe06000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAdd(27); break; case 28: if ((0x87ffe06000000000L & l) != 0L) jjCheckNAddTwoStates(28, 29); break; case 29: if (curChar == 40) jjCheckNAdd(30); break; case 30: if ((0xfffffdffffffdbffL & l) != 0L) jjCheckNAddTwoStates(30, 31); break; case 31: if (curChar == 41 && kind > 20) kind = 20; break; case 32: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAdd(32); break; case 33: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(0, 3); break; case 34: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(34, 35); break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddTwoStates(35, 36); break; case 36: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(27, 29); break; case 37: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(37, 38); break; case 38: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(30, 32); break; case 40: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(33, 36); break; case 41: if (curChar != 10) break; if (kind > 25) kind = 25; jjCheckNAddTwoStates(42, 44); break; case 42: case 43: if (curChar == 10 && kind > 24) kind = 24; break; case 44: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 43; break; case 45: if (curChar == 13) jjAddStates(9, 10); break; case 46: if (curChar == 10) jjCheckNAddTwoStates(42, 44); break; case 47: if (curChar == 10 && kind > 25) kind = 25; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 10: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 15) kind = 15; jjCheckNAdd(9); } else if (curChar == 64) { if (kind > 16) kind = 16; jjCheckNAdd(11); } break; case 7: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); } else if ((0xf8000001f8000001L & l) != 0L) { if (kind > 32) kind = 32; } if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(0, 3); else if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; else if (curChar == 91) jjstateSet[jjnewStateCnt++] = 0; if (curChar == 94) jjCheckNAdd(9); break; case 49: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(11, 13); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 48: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(11, 13); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 0: if (curChar == 91) jjCheckNAddTwoStates(1, 2); break; case 1: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(11, 13); break; case 2: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(14, 16); break; case 4: if (curChar == 93 && kind > 9) kind = 9; break; case 5: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; break; case 6: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(17, 20); break; case 8: if (curChar == 94) jjCheckNAdd(9); break; case 9: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 15) kind = 15; jjCheckNAdd(9); break; case 11: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 16) kind = 16; jjCheckNAdd(11); break; case 12: if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; break; case 16: if ((0xf8000001f8000001L & l) != 0L && kind > 32) kind = 32; break; case 17: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); break; case 18: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(18, 19); break; case 19: if (curChar == 64) jjCheckNAdd(20); break; case 20: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(20, 21); break; case 22: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(23); break; case 23: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAddStates(21, 23); break; case 24: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(24, 25); break; case 26: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAddStates(24, 26); break; case 27: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAdd(27); break; case 28: if ((0x47fffffe87ffffffL & l) != 0L) jjCheckNAddTwoStates(28, 29); break; case 30: jjAddStates(37, 38); break; case 32: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAdd(32); break; case 33: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(0, 3); break; case 34: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(34, 35); break; case 35: if ((0x7fffffe00000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddTwoStates(35, 36); break; case 36: if ((0x7fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(27, 29); break; case 37: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(37, 38); break; case 38: if ((0x7fffffe00000000L & l) != 0L) jjCheckNAddStates(30, 32); break; case 39: if (curChar == 96 && kind > 22) kind = 22; break; case 40: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(33, 36); break; default : break; } } while(i != startsAt); } else { int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 7: if ((jjbitVec0[i2] & l2) != 0L && kind > 32) kind = 32; break; case 49: case 1: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(11, 13); break; case 48: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(11, 13); break; case 3: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(14, 16); break; case 6: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(17, 20); break; case 30: if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(37, 38); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 48 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
if ((0x87ffe06000000000L & l) != 0L)
if ((0xa7ffe06000000000L & l) != 0L)
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 48; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 10: case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 15) kind = 15; jjCheckNAdd(9); break; case 7: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 32) kind = 32; } else if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(0, 3); if ((0x3ff000000000000L & l) != 0L) { if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); } else if ((0x100000200L & l) != 0L) { if (kind > 27) kind = 27; } else if (curChar == 13) jjAddStates(9, 10); else if (curChar == 10) { if (kind > 25) kind = 25; jjCheckNAddTwoStates(42, 44); } if (curChar == 32) jjstateSet[jjnewStateCnt++] = 14; break; case 49: case 1: jjCheckNAddStates(11, 13); break; case 48: jjCheckNAddStates(11, 13); break; case 3: jjCheckNAddStates(14, 16); break; case 6: jjCheckNAddStates(17, 20); break; case 11: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 16) kind = 16; jjstateSet[jjnewStateCnt++] = 11; break; case 13: if (curChar == 32) jjstateSet[jjnewStateCnt++] = 14; break; case 14: if (curChar == 32 && kind > 26) kind = 26; break; case 15: if ((0x100000200L & l) != 0L && kind > 27) kind = 27; break; case 16: if ((0xfc00ffffffffffffL & l) != 0L && kind > 32) kind = 32; break; case 17: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); break; case 18: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(18, 19); break; case 20: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(20, 21); break; case 21: if (curChar == 46) jjstateSet[jjnewStateCnt++] = 22; break; case 22: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(23); break; case 23: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAddStates(21, 23); break; case 24: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(24, 25); break; case 25: if (curChar == 58) jjstateSet[jjnewStateCnt++] = 26; break; case 26: if ((0x87ffe06000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAddStates(24, 26); break; case 27: if ((0x87ffe06000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAdd(27); break; case 28: if ((0x87ffe06000000000L & l) != 0L) jjCheckNAddTwoStates(28, 29); break; case 29: if (curChar == 40) jjCheckNAdd(30); break; case 30: if ((0xfffffdffffffdbffL & l) != 0L) jjCheckNAddTwoStates(30, 31); break; case 31: if (curChar == 41 && kind > 20) kind = 20; break; case 32: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAdd(32); break; case 33: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(0, 3); break; case 34: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(34, 35); break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddTwoStates(35, 36); break; case 36: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(27, 29); break; case 37: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(37, 38); break; case 38: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(30, 32); break; case 40: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(33, 36); break; case 41: if (curChar != 10) break; if (kind > 25) kind = 25; jjCheckNAddTwoStates(42, 44); break; case 42: case 43: if (curChar == 10 && kind > 24) kind = 24; break; case 44: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 43; break; case 45: if (curChar == 13) jjAddStates(9, 10); break; case 46: if (curChar == 10) jjCheckNAddTwoStates(42, 44); break; case 47: if (curChar == 10 && kind > 25) kind = 25; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 10: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 15) kind = 15; jjCheckNAdd(9); } else if (curChar == 64) { if (kind > 16) kind = 16; jjCheckNAdd(11); } break; case 7: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); } else if ((0xf8000001f8000001L & l) != 0L) { if (kind > 32) kind = 32; } if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(0, 3); else if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; else if (curChar == 91) jjstateSet[jjnewStateCnt++] = 0; if (curChar == 94) jjCheckNAdd(9); break; case 49: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(11, 13); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 48: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(11, 13); else if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 0: if (curChar == 91) jjCheckNAddTwoStates(1, 2); break; case 1: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(11, 13); break; case 2: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(14, 16); break; case 4: if (curChar == 93 && kind > 9) kind = 9; break; case 5: if (curChar == 93) jjstateSet[jjnewStateCnt++] = 4; break; case 6: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddStates(17, 20); break; case 8: if (curChar == 94) jjCheckNAdd(9); break; case 9: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 15) kind = 15; jjCheckNAdd(9); break; case 11: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 16) kind = 16; jjCheckNAdd(11); break; case 12: if (curChar == 94) jjstateSet[jjnewStateCnt++] = 10; break; case 16: if ((0xf8000001f8000001L & l) != 0L && kind > 32) kind = 32; break; case 17: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAddStates(4, 8); break; case 18: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(18, 19); break; case 19: if (curChar == 64) jjCheckNAdd(20); break; case 20: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(20, 21); break; case 22: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(23); break; case 23: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAddStates(21, 23); break; case 24: if ((0x7fffffe07fffffeL & l) != 0L) jjCheckNAddTwoStates(24, 25); break; case 26: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAddStates(24, 26); break; case 27: if ((0x47fffffe87ffffffL & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAdd(27); break; case 28: if ((0x47fffffe87ffffffL & l) != 0L) jjCheckNAddTwoStates(28, 29); break; case 30: jjAddStates(37, 38); break; case 32: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAdd(32); break; case 33: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(0, 3); break; case 34: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(34, 35); break; case 35: if ((0x7fffffe00000000L & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddTwoStates(35, 36); break; case 36: if ((0x7fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAddStates(27, 29); break; case 37: if ((0x7fffffeL & l) != 0L) jjCheckNAddTwoStates(37, 38); break; case 38: if ((0x7fffffe00000000L & l) != 0L) jjCheckNAddStates(30, 32); break; case 39: if (curChar == 96 && kind > 22) kind = 22; break; case 40: if ((0x7fffffeL & l) != 0L) jjCheckNAddStates(33, 36); break; default : break; } } while(i != startsAt); } else { int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 7: if ((jjbitVec0[i2] & l2) != 0L && kind > 32) kind = 32; break; case 49: case 1: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(11, 13); break; case 48: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(11, 13); break; case 3: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(14, 16); break; case 6: if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(17, 20); break; case 30: if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(37, 38); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 48 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
connection = new XMPPConnection(serverName);
connection = new SSLXMPPConnection(serverName);
private boolean login() { final SessionManager sessionManager = SparkManager.getSessionManager(); boolean hasErrors = false; String errorMessage = null; // Handle specifyed Workgroup String serverName = getServerName(); if (!hasErrors) { localPref = SettingsManager.getLocalPreferences(); SmackConfiguration.setPacketReplyTimeout(localPref.getTimeOut() * 1000); // Get connection try { int port = localPref.getXmppPort(); int checkForPort = serverName.indexOf(":"); if (checkForPort != -1) { String portString = serverName.substring(checkForPort + 1); if (ModelUtil.hasLength(portString)) { // Set new port. port = Integer.valueOf(portString).intValue(); } } boolean useSSL = localPref.isSSL(); boolean hostPortConfigured = localPref.isHostAndPortConfigured(); if (useSSL) { if (!hostPortConfigured) { connection = new XMPPConnection(serverName); } else { connection = new XMPPConnection(localPref.getXmppHost(), port, serverName); } } else { if (!hostPortConfigured) { connection = new XMPPConnection(serverName); } else { connection = new XMPPConnection(localPref.getXmppHost(), port, serverName); } } connection.connect(); String resource = localPref.getResource(); if (!ModelUtil.hasLength(resource)) { resource = "spark"; } connection.login(getUsername(), getPassword(), resource, false); // Subscriptions are always manual Roster roster = connection.getRoster(); roster.setSubscriptionMode(Roster.SubscriptionMode.manual); sessionManager.setServerAddress(connection.getServiceName()); sessionManager.initializeSession(connection, getUsername(), getPassword()); final String jid = getUsername() + '@' + sessionManager.getServerAddress() + "/" + resource; sessionManager.setJID(jid); } catch (Exception xee) { if (!loginDialog.isVisible()) { loginDialog.setVisible(true); } if (xee instanceof XMPPException) { XMPPException xe = (XMPPException)xee; final XMPPError error = xe.getXMPPError(); int errorCode = 0; if (error != null) { errorCode = error.getCode(); } if (errorCode == 401) { errorMessage = SparkRes.getString(SparkRes.INVALID_USERNAME_PASSWORD); } else if (errorCode == 502 || errorCode == 504) { errorMessage = SparkRes.getString(SparkRes.SERVER_UNAVAILABLE); } else { errorMessage = SparkRes.getString(SparkRes.UNRECOVERABLE_ERROR); } } else { errorMessage = SparkRes.getString(SparkRes.UNRECOVERABLE_ERROR); } // Log Error Log.warning("Exception in Login:", xee); hasErrors = true; } } if (hasErrors) { progressBar.setVisible(false); //progressBar.setIndeterminate(false); // Show error dialog if (loginDialog.isVisible()) { JOptionPane.showMessageDialog(loginDialog, errorMessage, SparkRes.getString(SparkRes.ERROR_DIALOG_TITLE), JOptionPane.ERROR_MESSAGE); } setEnabled(true); return false; } // Since the connection and workgroup are valid. Add a ConnectionListener connection.addConnectionListener(SparkManager.getSessionManager()); // Persist information localPref.setUsername(getUsername()); String encodedPassword = null; try { encodedPassword = Encryptor.encrypt(getPassword()); } catch (Exception e) { Log.error("Error encrypting password.", e); } localPref.setPassword(encodedPassword); localPref.setSavePassword(savePasswordBox.isSelected()); localPref.setAutoLogin(autoLoginBox.isSelected()); localPref.setServer(serverField.getText()); SettingsManager.saveSettings(); return !hasErrors; }
connection = new XMPPConnection(localPref.getXmppHost(), port, serverName);
connection = new SSLXMPPConnection(localPref.getXmppHost(), port, serverName);
private boolean login() { final SessionManager sessionManager = SparkManager.getSessionManager(); boolean hasErrors = false; String errorMessage = null; // Handle specifyed Workgroup String serverName = getServerName(); if (!hasErrors) { localPref = SettingsManager.getLocalPreferences(); SmackConfiguration.setPacketReplyTimeout(localPref.getTimeOut() * 1000); // Get connection try { int port = localPref.getXmppPort(); int checkForPort = serverName.indexOf(":"); if (checkForPort != -1) { String portString = serverName.substring(checkForPort + 1); if (ModelUtil.hasLength(portString)) { // Set new port. port = Integer.valueOf(portString).intValue(); } } boolean useSSL = localPref.isSSL(); boolean hostPortConfigured = localPref.isHostAndPortConfigured(); if (useSSL) { if (!hostPortConfigured) { connection = new XMPPConnection(serverName); } else { connection = new XMPPConnection(localPref.getXmppHost(), port, serverName); } } else { if (!hostPortConfigured) { connection = new XMPPConnection(serverName); } else { connection = new XMPPConnection(localPref.getXmppHost(), port, serverName); } } connection.connect(); String resource = localPref.getResource(); if (!ModelUtil.hasLength(resource)) { resource = "spark"; } connection.login(getUsername(), getPassword(), resource, false); // Subscriptions are always manual Roster roster = connection.getRoster(); roster.setSubscriptionMode(Roster.SubscriptionMode.manual); sessionManager.setServerAddress(connection.getServiceName()); sessionManager.initializeSession(connection, getUsername(), getPassword()); final String jid = getUsername() + '@' + sessionManager.getServerAddress() + "/" + resource; sessionManager.setJID(jid); } catch (Exception xee) { if (!loginDialog.isVisible()) { loginDialog.setVisible(true); } if (xee instanceof XMPPException) { XMPPException xe = (XMPPException)xee; final XMPPError error = xe.getXMPPError(); int errorCode = 0; if (error != null) { errorCode = error.getCode(); } if (errorCode == 401) { errorMessage = SparkRes.getString(SparkRes.INVALID_USERNAME_PASSWORD); } else if (errorCode == 502 || errorCode == 504) { errorMessage = SparkRes.getString(SparkRes.SERVER_UNAVAILABLE); } else { errorMessage = SparkRes.getString(SparkRes.UNRECOVERABLE_ERROR); } } else { errorMessage = SparkRes.getString(SparkRes.UNRECOVERABLE_ERROR); } // Log Error Log.warning("Exception in Login:", xee); hasErrors = true; } } if (hasErrors) { progressBar.setVisible(false); //progressBar.setIndeterminate(false); // Show error dialog if (loginDialog.isVisible()) { JOptionPane.showMessageDialog(loginDialog, errorMessage, SparkRes.getString(SparkRes.ERROR_DIALOG_TITLE), JOptionPane.ERROR_MESSAGE); } setEnabled(true); return false; } // Since the connection and workgroup are valid. Add a ConnectionListener connection.addConnectionListener(SparkManager.getSessionManager()); // Persist information localPref.setUsername(getUsername()); String encodedPassword = null; try { encodedPassword = Encryptor.encrypt(getPassword()); } catch (Exception e) { Log.error("Error encrypting password.", e); } localPref.setPassword(encodedPassword); localPref.setSavePassword(savePasswordBox.isSelected()); localPref.setAutoLogin(autoLoginBox.isSelected()); localPref.setServer(serverField.getText()); SettingsManager.saveSettings(); return !hasErrors; }
Log.error(e);
public void initialize() { ProviderManager.addExtensionProvider("phone-event", "http://jivesoftware.com/xmlns/phone", new PhoneEventPacketExtensionProvider()); ProviderManager.addIQProvider("phone-action", "http://jivesoftware.com/xmlns/phone", new PhoneActionIQProvider()); final XMPPConnection con = SparkManager.getConnection(); SwingWorker worker = new SwingWorker() { public Object construct() { try { phoneClient = new PhoneClient(con); // Add BaseListener phoneClient.addEventListener(new PhoneListener()); } catch (Exception e) { // Ignore because the user does not have support. //Log.error(e); } return phoneClient; } public void finished() { if (phoneClient != null) { setupPhoneSystem(); } } }; worker.start(); }
Log.error(e);
public Object construct() { try { phoneClient = new PhoneClient(con); // Add BaseListener phoneClient.addEventListener(new PhoneListener()); } catch (Exception e) { // Ignore because the user does not have support. //Log.error(e); } return phoneClient; }
for (Transport transport : TransportManager.getTransports()) { if (TransportManager.isRegistered(SparkManager.getConnection(), transport)) {
for (Transport transport : TransportUtils.getTransports()) { if (TransportUtils.isRegistered(SparkManager.getConnection(), transport)) {
public List<AccountItem> getAccounts() { List<AccountItem> list = new ArrayList<AccountItem>(); for (Transport transport : TransportManager.getTransports()) { if (TransportManager.isRegistered(SparkManager.getConnection(), transport)) { AccountItem item = new AccountItem(transport.getIcon(), transport.getName(), transport); list.add(item); } } return list; }
configureMenu();
buildMenu();
private MainWindow(String title, ImageIcon icon) { // Initialize and dock the menus configureMenu(); // Add Workspace Container getContentPane().setLayout(new BorderLayout()); // Add menubar this.setJMenuBar(mainWindowBar); this.getContentPane().add(topBar, BorderLayout.NORTH); setTitle(title + " - " + SparkManager.getSessionManager().getUsername()); setIconImage(icon.getImage()); // Setup WindowListener to be the proxy to the actual window listener // which cannot normally be used outside of the Window component because // of protected access. addWindowListener(new WindowAdapter() { /** * This event fires when the window has become active. * * @param e WindowEvent is not used. */ public void windowActivated(WindowEvent e) { fireWindowActivated(); } /** * Invoked when a window is de-activated. */ public void windowDeactivated(WindowEvent e) { } /** * This event fires whenever a user minimizes the window * from the toolbar. * * @param e WindowEvent is not used. */ public void windowIconified(WindowEvent e) { } /** * This event fires when the application is closing. * This allows Plugins to do any persistence or other * work before exiting. * * @param e WindowEvent is never used. */ public void windowClosing(WindowEvent e) { setVisible(false); // Show confirmation about hiding. // SparkManager.getNotificationsEngine().confirmHidingIfNecessary(); } }); this.addWindowFocusListener(new MainWindowFocusListener()); }
checkUpdate(false);
checkForUpdates(false);
public void run() { checkUpdate(false); }
checkUpdate(true);
checkForUpdates(true);
public void actionPerformed(ActionEvent actionEvent) { checkUpdate(true); }
String status = inputTextDialog.getInput("Status Message", "Let others know your current status or activity.",
String status = inputTextDialog.getInput(Res.getString("title.status.message"), Res.getString("message.current.status"),
public void logout(boolean sendStatus) { final XMPPConnection con = SparkManager.getConnection(); if (con.isConnected() && sendStatus) { final InputTextAreaDialog inputTextDialog = new InputTextAreaDialog(); String status = inputTextDialog.getInput("Status Message", "Let others know your current status or activity.", SparkRes.getImageIcon(SparkRes.USER1_MESSAGE_24x24), this); if (status != null) { Presence presence = new Presence(Presence.Type.unavailable); presence.setStatus(status); con.sendPacket(presence); } } // Set auto-login to false SettingsManager.getLocalPreferences().setAutoLogin(false); // Notify all MainWindowListeners try { fireWindowShutdown(); setVisible(false); } finally { final SwingWorker shutdownThread = new SwingWorker() { public Object construct() { try { Thread.sleep(10); } catch (InterruptedException e) { Log.error(e); } return true; } public void finished() { closeConnectionAndInvoke(); } }; shutdownThread.start(); } }
try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e));
if (service != null) { try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); }
public void destroy(StopStrategy stopStrategy) throws IllegalServiceStateException, UnsatisfiedConditionsException { // if we are not restartable, we need to stop try { if (!stop(stopStrategy)) { throw new IllegalServiceStateException("Service did not stop", serviceName); } } catch (UnsatisfiedConditionsException e) { throw e; } if (!serviceFactory.isRestartable()) { lock("destroy"); try { if (state != ServiceState.STOPPED) { state = ServiceState.STARTING; serviceMonitor.serviceStopping(createServiceEvent()); try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } finally { unlock(); } } // cool we can unregistered serviceMonitor.serviceUnregistered(createServiceEvent()); }
if (startConditions != null) { List errors = startConditions.destroy();
if (startCondition != null) { List errors = startCondition.destroy();
private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } }
startConditions = null;
startCondition = null;
private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } }
if (stopConditions != null) { List errors = stopConditions.destroy();
if (stopCondition != null) { List errors = stopCondition.destroy();
private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } }
stopConditions = null;
stopCondition = null;
private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } }
stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory);
stopCondition = new NonRestartableStopCondition(kernel, serviceName, classLoader, lock, serviceFactory);
public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { if (!serviceFactory.isRestartable() && !serviceFactory.isEnabled()) { throw new IllegalServiceStateException("A disabled non-restartable service factory can not be initalized", serviceName); } serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { serviceMonitor.serviceUnregistered(createServiceEvent()); Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } }
synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); }
public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } }
startConditions.initialize();
startCondition = new AggregateCondition(kernel, serviceName, classLoader, lock, serviceFactory.getStartConditions()); startCondition.initialize();
public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } }
Set unsatisfiedConditions = startConditions.getUnsatisfied();
Set unsatisfiedConditions = startCondition.getUnsatisfied();
public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } }
startConditions.awaitSatisfaction();
startCondition.awaitSatisfaction();
public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } }
if (stopConditions == null) { synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); }
if (stopCondition == null) {
public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } }
stopConditions.initialize();
stopCondition = new AggregateCondition(kernel, serviceName, classLoader, lock, serviceFactory.getStopConditions()); stopCondition.initialize();
public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } }
Set unsatisfiedConditions = stopConditions.getUnsatisfied();
Set unsatisfiedConditions = stopCondition.getUnsatisfied();
public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } }
stopConditions.awaitSatisfaction();
stopCondition.awaitSatisfaction();
public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } }
try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e));
if (service != null) { try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); }
public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } }
workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this);
workspace.getWorkspacePane().addTab(Res.getString("tab.contacts"), SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this);
private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups")); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); }
final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts");
final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName(Res.getString("menuitem.contacts"));
private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups")); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); }
ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group");
ResourceUtils.resButton(addContactsMenu, Res.getString("menuitem.add.contact")); ResourceUtils.resButton(addContactGroupMenu, Res.getString("menuitem.add.contact.group"));
private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups")); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); }
ResourceUtils.resButton(incomingMessageBox, "&Play sound when new message arrives"); ResourceUtils.resButton(outgoingMessageBox, "&Play sound when a message is sent"); ResourceUtils.resButton(userOfflineCheckbox, "&Play sound when user goes offline");
ResourceUtils.resButton(incomingMessageBox, "Play sound when new message &arrives"); ResourceUtils.resButton(outgoingMessageBox, "Play sound when a message is &sent"); ResourceUtils.resButton(userOfflineCheckbox, "Play sound when user goes &offline");
public SoundPanel() { setLayout(new GridBagLayout()); // Add ResourceUtils ResourceUtils.resButton(incomingMessageBox, "&Play sound when new message arrives"); ResourceUtils.resButton(outgoingMessageBox, "&Play sound when a message is sent"); ResourceUtils.resButton(userOfflineCheckbox, "&Play sound when user goes offline"); ResourceUtils.resButton(incomingBrowseButton, "&Browse"); ResourceUtils.resButton(outgoingBrowseButton, "B&rowse"); ResourceUtils.resButton(offlineBrowseButton, "Br&owse"); // Handle incoming sounds add(incomingMessageBox, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(incomingMessageSound, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(incomingBrowseButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); // Handle sending sounds add(outgoingMessageBox, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(outgoingMessageSound, new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(outgoingBrowseButton, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); // Handle User Online Sound add(userOfflineCheckbox, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(userOfflineField, new GridBagConstraints(0, 5, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(offlineBrowseButton, new GridBagConstraints(1, 5, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); incomingBrowseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pickFile("Choose Incoming Sound File", incomingMessageSound); } }); outgoingBrowseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pickFile("Choose Outgoing Sound File", outgoingMessageSound); } }); offlineBrowseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pickFile("Choose Offline Sound File", userOfflineField); } }); }
final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage();
private void retrieveNotes() { final PrivateNotes privateNotes = PrivateNotes.getPrivateNotes(); String text = privateNotes.getNotes(); final JLabel titleLabel = new JLabel("Notepad"); titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY)); titleLabel.setFont(new Font("Dialog", Font.BOLD, 13)); titleLabel.setHorizontalAlignment(JLabel.CENTER); final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); final JTextPane pane = new JTextPane(); pane.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(null); pane.setText(text); final RolloverButton button = new RolloverButton("Save", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); final JFrame frame = new JFrame("Notes"); frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } } }); mainPanel.setBackground(Color.white); mainPanel.setLayout(new GridBagLayout()); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().add(mainPanel); mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(scrollPane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(button, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); frame.pack(); frame.setSize(400, 400); GraphicUtils.centerWindowOnComponent(frame, SparkManager.getMainWindow()); frame.setVisible(true); pane.setCaretPosition(0); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); }
frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } };
final JPanel mainPanel = new JPanel();
private void retrieveNotes() { final PrivateNotes privateNotes = PrivateNotes.getPrivateNotes(); String text = privateNotes.getNotes(); final JLabel titleLabel = new JLabel("Notepad"); titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY)); titleLabel.setFont(new Font("Dialog", Font.BOLD, 13)); titleLabel.setHorizontalAlignment(JLabel.CENTER); final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); final JTextPane pane = new JTextPane(); pane.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(null); pane.setText(text); final RolloverButton button = new RolloverButton("Save", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); final JFrame frame = new JFrame("Notes"); frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } } }); mainPanel.setBackground(Color.white); mainPanel.setLayout(new GridBagLayout()); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().add(mainPanel); mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(scrollPane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(button, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); frame.pack(); frame.setSize(400, 400); GraphicUtils.centerWindowOnComponent(frame, SparkManager.getMainWindow()); frame.setVisible(true); pane.setCaretPosition(0); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); }
mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
private void retrieveNotes() { final PrivateNotes privateNotes = PrivateNotes.getPrivateNotes(); String text = privateNotes.getNotes(); final JLabel titleLabel = new JLabel("Notepad"); titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY)); titleLabel.setFont(new Font("Dialog", Font.BOLD, 13)); titleLabel.setHorizontalAlignment(JLabel.CENTER); final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); final JTextPane pane = new JTextPane(); pane.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(null); pane.setText(text); final RolloverButton button = new RolloverButton("Save", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); final JFrame frame = new JFrame("Notes"); frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } } }); mainPanel.setBackground(Color.white); mainPanel.setLayout(new GridBagLayout()); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().add(mainPanel); mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(scrollPane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(button, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); frame.pack(); frame.setSize(400, 400); GraphicUtils.centerWindowOnComponent(frame, SparkManager.getMainWindow()); frame.setVisible(true); pane.setCaretPosition(0); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); }
String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes);
public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); }
assert (!WebMacro.VERSION.equals("@BUILD_DATE"));
assert (!WebMacro.BUILD_DATE.equals("@BUILD_DATE@"));
public void testBuildDate() throws Exception { assert (!WebMacro.VERSION.equals("@BUILD_DATE")); }
{ return requst_.getRealPath("/"); }
{ return sc_.getRealPath("/"); }
final public String getDOCUMENT_ROOT() { return requst_.getRealPath("/"); }
String articlePath = getArticlePath(); return ContentUtil.getParentPath(articlePath);
String articlePath = getResourcePath(); if(articlePath!=null){ return ContentUtil.getParentPath(ContentUtil.getParentPath(articlePath)); } else { return null; }
public String getFolderLocation() { String articlePath = getArticlePath(); return ContentUtil.getParentPath(articlePath); }
moveToOfflineGroup(bareJID);
presence = roster.getPresence(bareJID); if (presence == null) { moveToOfflineGroup(bareJID); }
private void updateUserPresence(Presence presence) { if (presence == null) { return; } Roster roster = SparkManager.getConnection().getRoster(); final String bareJID = StringUtils.parseBareAddress(presence.getFrom()); RosterEntry entry = roster.getEntry(bareJID); boolean isPending = entry != null && (entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus(); // If online, check to see if they are in the offline group. // If so, remove from offline group and add to all groups they // belong to. if (presence.getType() == Presence.Type.available && offlineGroup.getContactItemByJID(bareJID) != null) { changeOfflineToOnline(bareJID, entry, presence); } else if (presence.getFrom().indexOf("workgroup.") != -1) { changeOfflineToOnline(bareJID, entry, presence); } // If online, but not in offline group, update presence. else if (presence.getType() == Presence.Type.available) { final Iterator groupIterator = groupList.iterator(); while (groupIterator.hasNext()) { ContactGroup group = (ContactGroup)groupIterator.next(); ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.setPresence(presence); group.fireContactGroupUpdated(); } } } // If not available, move to offline group. else if (presence.getType() == Presence.Type.unavailable && !isPending) { moveToOfflineGroup(bareJID); } }
XmlBeanDefinitionReader beanDefinitionReader = createBeanDefinitionReader(beanFactory);
XmlBeanDefinitionReader beanDefinitionReader = XBeanHelper.createBeanDefinitionReader(this, beanFactory, xmlPreprocessors);
protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException { // Create a new XmlBeanDefinitionReader for the given BeanFactory. XmlBeanDefinitionReader beanDefinitionReader = createBeanDefinitionReader(beanFactory); // Configure the bean definition reader with this context's // resource loading environment. beanDefinitionReader.setResourceLoader(this); beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this)); // Allow a subclass to provide custom initialization of the reader, // then proceed with actually loading the bean definitions. initBeanDefinitionReader(beanDefinitionReader); loadBeanDefinitions(beanDefinitionReader); }
ArticleListBean a = new ArticleListBean(articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+".xml", articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus());
ArticleListBean a = new ArticleListBean(articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+ArticleItemBean.ARTICLE_SUFFIX, articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus());
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = 0; ArticleItemBean[] articleItemBean; try { articleItemBean = (ArticleItemBean[])loadAllArticlesInFolder(ContentUtil.ARTICLE_PATH).toArray(new ArticleItemBean[0]); availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+".xml", articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(a, i); } } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } _dataModel.setRowCount(availableRows); }
Logger.logError(e.getMessage(), e);
Log.error(e.getMessage(), e);
private NSImage getImage(String image) { InputStream in = this.getClass().getResourceAsStream(image); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buff = new byte[10 * 1024]; int len; try { while ((len = in.read(buff)) != -1) { out.write(buff, 0, len); } in.close(); out.close(); } catch (IOException e) { Logger.logError(e.getMessage(), e); } NSData data = new NSData(out.toByteArray()); return new NSImage(data); }
WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(SEARCH_PUBLISHED_FROM_ID); em.addErrorMessage(SEARCH_PUBLISHED_TO_ID);
WFMessages em = new WFMessages(); em.addMessageToDisplay(SEARCH_PUBLISHED_FROM_ID); em.addMessageToDisplay(SEARCH_PUBLISHED_TO_ID);
private UIComponent getSearchPanel() { String ref = SEARCH_ARTICLE_BEAN_ID + "."; WFContainer mainContainer = new WFContainer(); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(SEARCH_PUBLISHED_FROM_ID); em.addErrorMessage(SEARCH_PUBLISHED_TO_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getFormPanel(3); //adding myfaces component stuff IWMainApplication iwma = IWMainApplication.getDefaultIWMainApplication(); IWBundle myfacesBundle = iwma.getBundle("org.apache.myfaces"); String jsPath = myfacesBundle.getResourcesVirtualPath()+"/popcalendar.js"; String styleSheet1Path = myfacesBundle.getResourcesVirtualPath()+"/style/WH/theme.css"; String styleSheet2Path = myfacesBundle.getResourcesVirtualPath()+"/style/DB/theme.css"; Stylesheet stylesheet = new Stylesheet(); stylesheet.setPath(styleSheet1Path); stylesheet.setId("css1"); mainContainer.add(stylesheet); Stylesheet stylesheet2 = new Stylesheet(); stylesheet2.setPath(styleSheet2Path); stylesheet2.setId("css2"); mainContainer.add(stylesheet2); Script script = new Script(); script.setScriptSource(jsPath); mainContainer.add(script); //myfaces done p.getChildren().add(WFUtil.getText("Article text:")); p.getChildren().add(WFUtil.getText("Author:")); p.getChildren().add(WFUtil.getText("Category")); HtmlInputText searchTextInput = WFUtil.getInputText(SEARCH_TEXT_ID, ref + "searchText"); searchTextInput.setSize(40); p.getChildren().add(searchTextInput); HtmlInputText searchAuthorInput = WFUtil.getInputText(SEARCH_AUTHOR_ID, ref + "searchAuthor"); searchAuthorInput.setSize(30); p.getChildren().add(searchAuthorInput); HtmlSelectOneMenu searchCategoryMenu = WFUtil.getSelectOneMenu(SEARCH_CATEGORY_ID, ref + "categories", ref + "searchCategory"); p.getChildren().add(searchCategoryMenu); p.getChildren().add(WFUtil.getText("Published from:")); p.getChildren().add(WFUtil.getText("Published to:")); p.getChildren().add(WFUtil.getText(" ")); // HtmlInputText searchPublishedFromInput = WFUtil.getInputText(SEARCH_PUBLISHED_FROM_ID, ref + "searchPublishedFrom"); // searchPublishedFromInput.setSize(20);// searchPublishedFromInput.setConverter(new WFDateConverter());// HtmlInputCalendar searchPublishedFromInput = new HtmlInputCalendar(); searchPublishedFromInput.setId("fromDate"); searchPublishedFromInput.setRenderAsPopup(true); WFUtil.setValueBinding(searchPublishedFromInput,"value",ref + "searchPublishedFrom"); p.getChildren().add(searchPublishedFromInput); // HtmlInputText searchPublishedToInput = WFUtil.getInputText(SEARCH_PUBLISHED_TO_ID, ref + "searchPublishedTo"); // searchPublishedToInput.setSize(20);// searchPublishedToInput.setConverter(new WFDateConverter()); HtmlInputCalendar searchPublishedToInput = new HtmlInputCalendar(); searchPublishedToInput.setId("toDate"); searchPublishedToInput.setRenderAsPopup(true); WFUtil.setValueBinding(searchPublishedToInput,"value",ref + "searchPublishedTo"); p.getChildren().add(searchPublishedToInput); p.getChildren().add(WFUtil.getText(" ")); mainContainer.add(p); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.getButton(SEARCH_BUTTON_ID, "Search", this)); mainContainer.add(p); return mainContainer; }
clazz = new Clazz("HelloWorld");
clazz = new Clazz("HelloWorld", new CoverageData());
public static void testClazz() { Clazz clazz; clazz = new Clazz("HelloWorld"); assertEquals("HelloWorld", clazz.getName()); assertEquals("", clazz.getPackageName()); assertEquals("HelloWorld.java", clazz.getLongFileName()); assertEquals("HelloWorld", clazz.getLongName()); assertEquals(0, clazz.getBranchCoverageRate(), 0); assertEquals(1.0, clazz.getLineCoverageRate(), 0); assertFalse(clazz.isValidSourceLine(19)); clazz = new Clazz("com.example.HelloWorld"); assertEquals("HelloWorld", clazz.getName()); assertEquals("com.example", clazz.getPackageName()); assertEquals("com/example/HelloWorld.java", clazz.getLongFileName()); assertEquals("com.example.HelloWorld", clazz.getLongName()); try { new Clazz(null); fail("Expected an IllegalArgumentException but did not receive one!"); } catch (IllegalArgumentException e) { //Good } }
clazz = new Clazz("com.example.HelloWorld");
clazz = new Clazz("com.example.HelloWorld", new CoverageData());
public static void testClazz() { Clazz clazz; clazz = new Clazz("HelloWorld"); assertEquals("HelloWorld", clazz.getName()); assertEquals("", clazz.getPackageName()); assertEquals("HelloWorld.java", clazz.getLongFileName()); assertEquals("HelloWorld", clazz.getLongName()); assertEquals(0, clazz.getBranchCoverageRate(), 0); assertEquals(1.0, clazz.getLineCoverageRate(), 0); assertFalse(clazz.isValidSourceLine(19)); clazz = new Clazz("com.example.HelloWorld"); assertEquals("HelloWorld", clazz.getName()); assertEquals("com.example", clazz.getPackageName()); assertEquals("com/example/HelloWorld.java", clazz.getLongFileName()); assertEquals("com.example.HelloWorld", clazz.getLongName()); try { new Clazz(null); fail("Expected an IllegalArgumentException but did not receive one!"); } catch (IllegalArgumentException e) { //Good } }
new Clazz(null);
new Clazz(null, new CoverageData());
public static void testClazz() { Clazz clazz; clazz = new Clazz("HelloWorld"); assertEquals("HelloWorld", clazz.getName()); assertEquals("", clazz.getPackageName()); assertEquals("HelloWorld.java", clazz.getLongFileName()); assertEquals("HelloWorld", clazz.getLongName()); assertEquals(0, clazz.getBranchCoverageRate(), 0); assertEquals(1.0, clazz.getLineCoverageRate(), 0); assertFalse(clazz.isValidSourceLine(19)); clazz = new Clazz("com.example.HelloWorld"); assertEquals("HelloWorld", clazz.getName()); assertEquals("com.example", clazz.getPackageName()); assertEquals("com/example/HelloWorld.java", clazz.getLongFileName()); assertEquals("com.example.HelloWorld", clazz.getLongName()); try { new Clazz(null); fail("Expected an IllegalArgumentException but did not receive one!"); } catch (IllegalArgumentException e) { //Good } }
Object value = getValue(getElementText(childElement), null);
Element valueElement = getFirstChildElement(childElement); Object value; if (valueElement != null) { value = parsePropertySubElement(valueElement, ""); } else { value = getElementText(childElement); }
protected Object parseCustomMapElement(MappingMetaData metadata, Element element, String name) { Map map = new HashMap(); Element parent = (Element) element.getParentNode(); String entryName = metadata.getMapEntryName(getLocalName(parent), name); String keyName = metadata.getMapKeyName(getLocalName(parent), name); if (entryName == null) entryName = "property"; if (keyName == null) keyName = "key"; // TODO : support further customizations //String valueName = "value"; //boolean keyIsAttr = true; //boolean valueIsAttr = false; NodeList nl = element.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element childElement = (Element) node; String localName = childElement.getLocalName(); String uri = childElement.getNamespaceURI(); if (localName == null || localName.equals("xmlns") || localName.startsWith("xmlns:")) { continue; } // we could use namespaced attributes to differentiate real spring // attributes from namespace-specific attributes if (!isEmpty(uri) && localName.equals(entryName)) { String key = childElement.getAttribute(keyName); if (key == null) throw new RuntimeException("No key defined for map " + entryName); Object keyValue = getValue(key, null); Object value = getValue(getElementText(childElement), null); map.put(keyValue, value); } } } return map; }
final VCardPanel vcardPanel = new VCardPanel(getParticipantJID()); getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
SwingWorker worker = new SwingWorker() { public Object construct() { return SparkManager.getVCardManager().getVCard(participantJID); } public void finished() { final VCard vcard = (VCard)get(); if (vcard == null) { return; } final VCardPanel vcardPanel = new VCardPanel(vcard, participantJID); getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); scrollOnTimer(); } }; worker.start();
public ChatRoomImpl(final String participantJID, String participantNickname, String title) { this.participantJID = participantJID; this.participantNickname = participantNickname; AndFilter presenceFilter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(this.participantJID)); // Register PacketListeners AndFilter messageFilter = new AndFilter(new PacketTypeFilter(Message.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(this, messageFilter); SparkManager.getConnection().addPacketListener(this, presenceFilter); // The roomname will be the participantJID this.roomname = participantJID; // Use the agents username as the Tab Title this.tabTitle = title; // The name of the room will be the node of the user jid + conversation. final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); this.roomTitle = participantNickname + " - Started " + formatter.format(new Date()); // Add RoomInfo this.getSplitPane().setRightComponent(null); getSplitPane().setDividerSize(0); messageManager = new ChatRoomMessageManager(); SparkManager.getMessageEventManager().addMessageEventNotificationListener(messageManager); roster = SparkManager.getConnection().getRoster(); presence = roster.getPresence(participantJID); StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(presence); RosterEntry entry = roster.getEntry(participantJID); if (statusItem == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else { String status = presence.getStatus(); if (status != null && status.indexOf("phone") != -1) { tabIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); } else { tabIcon = statusItem.getIcon(); } } Icon icon = SparkManager.getChatManager().getPresenceIconForContactHandler(presence); if (icon != null) { tabIcon = icon; } PacketFilter filter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { presence = (Presence)packet; } }, filter); // Create toolbar buttons. ChatRoomButton infoButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.PROFILE_IMAGE_24x24)); infoButton.setToolTipText("View information about this user"); // Create basic toolbar. getToolBar().addChatRoomButton(infoButton); // If the user is not in the roster, then allow user to add them. if (entry == null && !StringUtils.parseResource(participantJID).equals(participantNickname)) { ChatRoomButton addToRosterButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.ADD_IMAGE_24x24)); addToRosterButton.setToolTipText("Add this user to your roster."); getToolBar().addChatRoomButton(addToRosterButton); addToRosterButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(participantJID); rosterDialog.setDefaultNickname(getParticipantNickname()); rosterDialog.showRosterDialog(SparkManager.getChatManager().getChatContainer().getChatFrame()); } }); } // Show VCard. infoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { VCardManager vcard = SparkManager.getVCardManager(); vcard.viewProfile(participantJID, SparkManager.getChatManager().getChatContainer()); } }); // If this is a private chat from a group chat room, do not show toolbar. if (StringUtils.parseResource(participantJID).equals(participantNickname)) { getToolBar().setVisible(false); } typingTimer = new Timer(2000, new ActionListener() { public void actionPerformed(ActionEvent e) { long now = System.currentTimeMillis(); if (now - lastTypedCharTime > 2000) { if (!sendNotification) { // send cancel SparkManager.getMessageEventManager().sendCancelledNotification(getParticipantJID(), threadID); sendNotification = true; } } } }); typingTimer.start(); // Add message event request listener messageEventRequestListener = new ChatMessageEventRequestListener(); SparkManager.getMessageEventManager().addMessageEventRequestListener(messageEventRequestListener); // Add VCard Panel final VCardPanel vcardPanel = new VCardPanel(getParticipantJID()); getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); }
flatCollections);
flatCollections, superClasses, interfaces);
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections); }
assertStringTemplateEquals (tmpl, "pass");
assertStringTemplateEquals (tmpl, "pass\n");
public void testBeginEnd () throws Exception { String tmpl = "#if (true) #begin pass #end #else #begin fail #end"; assertStringTemplateEquals (tmpl, "pass"); tmpl = "#if (true)\n #begin pass\n #end\n #else\n #begin fail\n #end"; assertStringTemplateEquals (tmpl, "pass"); }
text = removeAbsoluteReferences(text);
protected String prettify(String toPrettify) { String text = toPrettify; if(text!=null){ //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); tidy.setShowWarnings(false); tidy.setCharEncoding(Configuration.UTF8); ByteArrayInputStream bais; try { bais = new ByteArrayInputStream(text.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); text = baos.toString("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } return text; }
if (!wiki.containsPage(pageName)) throw new PageActionException ("That page does not exist");
public void perform(WikiSystem wiki, WebContext wc, WikiUser user, WikiPage page) throws PageActionException { String pageName = wc.getForm ("jump"); pageName = WikiUtil.guessWikiTitle(pageName, wiki); if (!wiki.containsPage(pageName)) throw new PageActionException ("That page does not exist"); throw new RedirectException (pageName); }
URL url = SparkManager.getVCardManager().getAvatar(SparkManager.getSessionManager().getJID());
URL url = SparkManager.getVCardManager().getAvatar(participantJID);
public ChatRoomImpl(final String participantJID, String participantNickname, String title) { this.participantJID = participantJID; this.participantNickname = participantNickname; AndFilter presenceFilter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); // Register PacketListeners AndFilter messageFilter = new AndFilter(new PacketTypeFilter(Message.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(this, messageFilter); SparkManager.getConnection().addPacketListener(this, presenceFilter); // The roomname will be the participantJID this.roomname = participantJID; // Use the agents username as the Tab Title this.tabTitle = title; // The name of the room will be the node of the user jid + conversation. final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); this.roomTitle = participantNickname; // Add RoomInfo this.getSplitPane().setRightComponent(null); getSplitPane().setDividerSize(0); roster = SparkManager.getConnection().getRoster(); presence = roster.getPresence(participantJID); RosterEntry entry = roster.getEntry(participantJID); tabIcon = SparkManager.getUserManager().getTabIconForPresence(presence); PacketFilter filter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { presence = (Presence)packet; } }, filter); // Create toolbar buttons. ChatRoomButton infoButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.PROFILE_IMAGE_24x24)); infoButton.setToolTipText(Res.getString("message.view.information.about.this.user")); // Create basic toolbar. getToolBar().addChatRoomButton(infoButton); // If the user is not in the roster, then allow user to add them. if (entry == null && !StringUtils.parseResource(participantJID).equals(participantNickname)) { ChatRoomButton addToRosterButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.ADD_IMAGE_24x24)); addToRosterButton.setToolTipText(Res.getString("message.add.this.user.to.your.roster")); getToolBar().addChatRoomButton(addToRosterButton); addToRosterButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(participantJID); rosterDialog.setDefaultNickname(getParticipantNickname()); rosterDialog.showRosterDialog(SparkManager.getChatManager().getChatContainer().getChatFrame()); } }); } // Show VCard. infoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { VCardManager vcard = SparkManager.getVCardManager(); vcard.viewProfile(participantJID, SparkManager.getChatManager().getChatContainer()); } }); // If this is a private chat from a group chat room, do not show toolbar. if (StringUtils.parseResource(participantJID).equals(participantNickname)) { getToolBar().setVisible(false); } typingTimer = new Timer(2000, new ActionListener() { public void actionPerformed(ActionEvent e) { if (!sendTypingNotification) { return; } long now = System.currentTimeMillis(); if (now - lastTypedCharTime > 2000) { if (!sendNotification) { // send cancel SparkManager.getMessageEventManager().sendCancelledNotification(getParticipantJID(), threadID); sendNotification = true; } } } }); typingTimer.start(); lastActivity = System.currentTimeMillis(); String time = formatter.format(new Date()); transcriptWindow.setInnerHTML("chatName", participantNickname); transcriptWindow.setInnerHTML("timeOpened", "Conversation started on " + time); URL url = SparkManager.getVCardManager().getAvatar(SparkManager.getSessionManager().getJID()); if (url != null) { transcriptWindow.setInnerHTML("incomingIconPath", "<img src=\"" + url.toExternalForm() + "\">"); } }
final ChatPreferences pref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE);
LocalPreferences pref = SettingsManager.getLocalPreferences();
private void createRoom() { ConferenceCreator mucRoomDialog = new ConferenceCreator(); final MultiUserChat groupChat = mucRoomDialog.createGroupChat(SparkManager.getMainWindow(), serviceName); final ChatPreferences pref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); if (null != groupChat) { // Join Room try { GroupChatRoom room = new GroupChatRoom(groupChat); chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); groupChat.create(pref.getNickname()); // Send Form Form form = groupChat.getConfigurationForm().createAnswerForm(); if (mucRoomDialog.isPasswordProtected()) { String password = mucRoomDialog.getPassword(); form.setAnswer("muc#roomconfig_passwordprotectedroom", true); form.setAnswer("muc#roomconfig_roomsecret", password); } form.setAnswer("muc#roomconfig_roomname", mucRoomDialog.getRoomName()); if (mucRoomDialog.isPermanent()) { form.setAnswer("muc#roomconfig_persistentroom", true); } List owners = new ArrayList(); owners.add(SparkManager.getSessionManager().getBareAddress()); form.setAnswer("muc#roomconfig_roomowners", owners); // new DataFormDialog(groupChat, form); groupChat.sendConfigurationForm(form); } catch (XMPPException e1) { Log.error("Error creating new room.", e1); } addRoomToTable(groupChat.getRoom(), StringUtils.parseName(groupChat.getRoom()), 1); } }
EqualCondition(Condition l, Condition r) { _l = l; _r = r; }
EqualCondition(Macro l, Macro r) { _l = l; _r = r; }
EqualCondition(Condition l, Condition r) { _l = l; _r = r; }
boolean lcond = (l instanceof Condition); boolean rcond = (r instanceof Condition);
boolean lmacro = (l instanceof Macro); boolean rmacro = (r instanceof Macro);
public final Object build(BuildContext pc) throws BuildException { Object l, r; l = _l.build(pc); r = _r.build(pc); boolean lcond = (l instanceof Condition); boolean rcond = (r instanceof Condition); if (!lcond && !rcond) { if ((l == null) || (r == null)) { return (l == r) ? Boolean.TRUE : Boolean.FALSE; } else { return (l.equals(r)) ? Boolean.TRUE : Boolean.FALSE; } } if (lcond && rcond) { return new EqualCondition((Condition) l, (Condition) r); } if (lcond) { return new EqualConstantCondition((Condition) l, r); } else { return new EqualConstantCondition((Condition) r, l); } }
if (!lcond && !rcond) {
if (!lmacro && !rmacro) {
public final Object build(BuildContext pc) throws BuildException { Object l, r; l = _l.build(pc); r = _r.build(pc); boolean lcond = (l instanceof Condition); boolean rcond = (r instanceof Condition); if (!lcond && !rcond) { if ((l == null) || (r == null)) { return (l == r) ? Boolean.TRUE : Boolean.FALSE; } else { return (l.equals(r)) ? Boolean.TRUE : Boolean.FALSE; } } if (lcond && rcond) { return new EqualCondition((Condition) l, (Condition) r); } if (lcond) { return new EqualConstantCondition((Condition) l, r); } else { return new EqualConstantCondition((Condition) r, l); } }
if (lcond && rcond) { return new EqualCondition((Condition) l, (Condition) r);
if (lmacro && rmacro) { return new EqualCondition((Macro) l, (Macro) r);
public final Object build(BuildContext pc) throws BuildException { Object l, r; l = _l.build(pc); r = _r.build(pc); boolean lcond = (l instanceof Condition); boolean rcond = (r instanceof Condition); if (!lcond && !rcond) { if ((l == null) || (r == null)) { return (l == r) ? Boolean.TRUE : Boolean.FALSE; } else { return (l.equals(r)) ? Boolean.TRUE : Boolean.FALSE; } } if (lcond && rcond) { return new EqualCondition((Condition) l, (Condition) r); } if (lcond) { return new EqualConstantCondition((Condition) l, r); } else { return new EqualConstantCondition((Condition) r, l); } }
if (lcond) { return new EqualConstantCondition((Condition) l, r);
if (lmacro) { return new EqualConstantCondition((Macro) l, r);
public final Object build(BuildContext pc) throws BuildException { Object l, r; l = _l.build(pc); r = _r.build(pc); boolean lcond = (l instanceof Condition); boolean rcond = (r instanceof Condition); if (!lcond && !rcond) { if ((l == null) || (r == null)) { return (l == r) ? Boolean.TRUE : Boolean.FALSE; } else { return (l.equals(r)) ? Boolean.TRUE : Boolean.FALSE; } } if (lcond && rcond) { return new EqualCondition((Condition) l, (Condition) r); } if (lcond) { return new EqualConstantCondition((Condition) l, r); } else { return new EqualConstantCondition((Condition) r, l); } }
return new EqualConstantCondition((Condition) r, l);
return new EqualConstantCondition((Macro) r, l);
public final Object build(BuildContext pc) throws BuildException { Object l, r; l = _l.build(pc); r = _r.build(pc); boolean lcond = (l instanceof Condition); boolean rcond = (r instanceof Condition); if (!lcond && !rcond) { if ((l == null) || (r == null)) { return (l == r) ? Boolean.TRUE : Boolean.FALSE; } else { return (l.equals(r)) ? Boolean.TRUE : Boolean.FALSE; } } if (lcond && rcond) { return new EqualCondition((Condition) l, (Condition) r); } if (lcond) { return new EqualConstantCondition((Condition) l, r); } else { return new EqualConstantCondition((Condition) r, l); } }
EqualConstantCondition(Condition l, Object r) { _l = l; _r = r; }
EqualConstantCondition(Macro l, Object r) { _l = l; _r = r; }
EqualConstantCondition(Condition l, Object r) { _l = l; _r = r; }
public SetDirective(Variable target, Object result) { this.target = target; this.result = result; }
public SetDirective() {}
public SetDirective(Variable target, Object result) { this.target = target; this.result = result; }
_tools = null;
public Context(final Broker broker) { _broker = broker; _bean = null; _tools = null; _toolbox = null; _locals = null; }
_locals = null;
public Context(final Broker broker) { _broker = broker; _bean = null; _tools = null; _toolbox = null; _locals = null; }
protected Object clone() {
public Object clone() { Context c = null;
protected Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { return null; } }
return super.clone(); } catch (CloneNotSupportedException cnse) { return null;
c = (Context) super.clone(); } catch (CloneNotSupportedException e) {
protected Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { return null; } }
c._localState = null; c._beanState = null; c._state = 0; c._locals = null; c._bean = null; return c;
protected Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { return null; } }
Object res = get(names[0]); if (names.length == 1) { return res; } return PropertyOperator.getProperty(this,get(names[0]),names,1);
return getLocal(names);
public final Object getProperty(final Object[] names) throws PropertyException, InvalidContextException { if (names.length == 0) { return null; } else if (_bean == null) { Object res = get(names[0]); if (names.length == 1) { return res; } return PropertyOperator.getProperty(this,get(names[0]),names,1); } else { return PropertyOperator.getProperty(this,_bean,names); } }
final public Object getTool(String name)
final public Object getTool(Object name)
final public Object getTool(String name) throws InvalidContextException { try { if (_toolbox == null) { return null; } Object ret = (_tools != null) ? _tools.get(name) : null; if (ret == null) { ContextTool tool = (ContextTool) _toolbox.get(name); if (tool != null) { if (_tools == null) { _tools = new HashMap(); } ret = tool.init(this); _tools.put(name,ret); } } return ret; } catch (ClassCastException ce) { throw new InvalidContextException("Tool" + name + " does not implement the ContextTool interface!"); } }