⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverscope.java

📁 java开源的企业总线.xmlBlaster
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
   }   /**    * @return true if MomClientGateway is registered and key oid starts with "__cmd:" (case sensitiv)    */   public final boolean isAdministrationCommand(XmlKey xmlKey) throws XmlBlasterException {      if (this.momClientGateway == null) return false;      if (xmlKey == null) {         log.severe("Illegal null argument in isAdministrationCommand()");         Thread.dumpStack();         return false;      }      return xmlKey.isAdministrative();   }   /**    * Returns the callback layer implementation 'CbDispatchConnectionsHandler' on server side.    * In util.Global we return the client side implementation 'ClientDispatchConnectionsHandler'    * @return A new instance of CbDispatchConnectionsHandler    */   public DispatchConnectionsHandler createDispatchConnectionsHandler(DispatchManager dispatchManager) throws XmlBlasterException {      return new CbDispatchConnectionsHandler(this, dispatchManager);   }   /**    * Sets the authentication in the engine.Global scope.    * <p>    * Additionally the I_Authentication is registered in the <i>util.Global.addObjectEntry</i>    * under the name <i>"/xmlBlaster/I_Authenticate"</i> (see Constants.I_AUTHENTICATE_PROPERTY_KEY).<br />    * This allows lookup similar to a naming service if we are in the same JVM.    */   public void setAuthenticate(I_Authenticate auth) {      this.authenticate = auth;      addObjectEntry(Constants.I_AUTHENTICATE_PROPERTY_KEY, this.authenticate);   }   public I_Authenticate getAuthenticate() {      return this.authenticate;   }   public final MsgDistributorPluginManager getMsgDistributorPluginManager() {      if (this.msgDistributorPluginManager == null) {         synchronized (MsgDistributorPluginManager.class) {            if (this.msgDistributorPluginManager == null)               this.msgDistributorPluginManager = new MsgDistributorPluginManager(this);         }      }      return this.msgDistributorPluginManager;   }   public void setRequestBroker(RequestBroker requestBroker) {      this.requestBroker = requestBroker;   }   public RequestBroker getRequestBroker() {      return this.requestBroker;   }   /**    * A human readable name of the listener for logging.    * <p />    * Enforced by I_RunlevelListener    */   public String getName() {      return ME;   }   /**    * Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING    * <p />    * Enforced by I_RunlevelListener    */   public void runlevelChange(int from, int to, boolean force) throws org.xmlBlaster.util.XmlBlasterException {      //if (log.isLoggable(Level.FINER)) log.call(ME, "Changing from run level=" + from + " to level=" + to + " with force=" + force);      if (to == from)         return;      try {         if (to > from) { // startup            if (to == RunlevelManager.RUNLEVEL_STANDBY) {               getHttpServer(); // incarnate allow http based access (is for example used for CORBA-IOR download)            }            if (to == RunlevelManager.RUNLEVEL_CLEANUP) {            }            if (to == RunlevelManager.RUNLEVEL_RUNNING) {            }         }         else if (to < from) { // shutdown            if (to == RunlevelManager.RUNLEVEL_CLEANUP) {            }            if (to == RunlevelManager.RUNLEVEL_STANDBY) {            }            if (to <= RunlevelManager.RUNLEVEL_HALTED) {               shutdownHttpServer(); // should be an own Plugin ?               shutdown();            }         }      }      finally {         this.currRunlevel = to;      }   }   /**    * If property -xmlBlaster.isEmbedded true is set we return true here    * <p />    * An embedded server should not do any exit()    */   public boolean isEmbedded() {      return getProperty().get("xmlBlaster.isEmbedded", false);   }   public String getDump() throws XmlBlasterException {      StringBuffer sb = new StringBuffer(10000);      String offset = "\n";      sb.append(offset).append("<xmlBlaster id='").append(getId()).append("'");      sb.append(" version='").append(getVersion()).append("' counter='").append(counter).append("'");      sb.append("\n   ");      sb.append(" buildTimestamp='").append(getBuildTimestamp()).append("'");      sb.append(" buildJavaVendor='").append(getBuildJavaVendor()).append("'");      sb.append(" buildJavaVersion='").append(getBuildJavaVersion()).append("'");      sb.append("\n   ");      sb.append(" java.vendor='").append(System.getProperty("java.vendor")).append("'");      sb.append(" java.version='").append(System.getProperty("java.version")).append("'");      sb.append("\n   ");      sb.append(" os.name='").append(System.getProperty("os.name")).append("'");      sb.append(" os.version='").append(System.getProperty("os.version")).append("'");      sb.append("\n   ");      sb.append(" freeMemory='").append(Runtime.getRuntime().freeMemory()).append("'");      sb.append(" totalMemory='").append(Runtime.getRuntime().totalMemory()).append("'");      sb.append("\n   ");      sb.append(" dumpTimestamp='").append(IsoDateParser.getCurrentUTCTimestamp()).append("'");      //sb.append(" ='").append(get()).append("'");      sb.append(">");      sb.append(getProperty().toXml());      sb.append(offset).append(" <ThreadDump><![CDATA[");      sb.append(ThreadLister.listAllThreads());      sb.append(offset).append(" ]]></ThreadDump>");      if (getAuthenticate() != null) {         sb.append(getAuthenticate().toXml());         if (getAuthenticate().getXmlBlaster() != null) {            sb.append(getAuthenticate().getXmlBlaster().toXml());         }      }      sb.append(offset).append("</xmlBlaster>");      return sb.toString();   }   /**    * gets the object holding all configuration information for the plugins (both for    * statically loaded plugins (by the run level manager) and dynamically loaded    * plugins (such plugins loaded on client request).    */   public PluginHolder getPluginHolder() throws XmlBlasterException {      if (this.pluginHolder != null) return this.pluginHolder;      synchronized(this) {        if (this.pluginHolder == null) {           PluginHolderSaxFactory factory = new PluginHolderSaxFactory(this);           this.pluginHolder = factory.readConfigFile();         }         return this.pluginHolder;      }   }   public SubjectEntryShuffler getSubjectInfoShuffler() {      if (this.subjectEntryShuffler != null) return this.subjectEntryShuffler;      synchronized(SubjectEntryShuffler.class) {         if (this.subjectEntryShuffler == null) {            this.subjectEntryShuffler = new SubjectEntryShuffler(this);         }         return this.subjectEntryShuffler;      }   }   public String[] peekMessages(I_Queue queue, int numOfEntries, String label) throws XmlBlasterException {      if (numOfEntries == 0)         return new String[] { "Please pass number of messages to peak" };      if (queue == null)         return new String[] { "There is no " + label + " queue available" };      if (queue.getNumOfEntries() < 1)         return new String[] { "The " + label + " queue is empty" };      java.util.ArrayList list = queue.peek(numOfEntries, -1);      if (list.size() == 0)         return new String[] { "Peeking messages from " + label + " queue failed, the reason is not known" };      int maxLength = getProperty().get("xmlBlaster/peekMessages/maxLength", 5000);      ArrayList tmpList = new ArrayList();      for (int i=0; i<list.size(); i++) {         ReferenceEntry entry = (ReferenceEntry)list.get(i);         MsgUnitWrapper wrapper = entry.getMsgUnitWrapper();         tmpList.add("<MsgUnit index='"+i+"'>");         if (wrapper == null) {            tmpList.add("  NOT REFERENCED");         }         else {            tmpList.add("  "+wrapper.getMsgKeyData().toXml());            String content = wrapper.getMsgUnit().getContentStr();            if (content.length() > (maxLength+5) ) {               content = content.substring(0, maxLength) + " ...";            }            tmpList.add("  <content size='"+wrapper.getMsgUnit().getContent().length+"'>"+content+"</content>");            tmpList.add("  "+wrapper.getMsgQosData().toXml());         }         tmpList.add("</MsgUnit>");      }      return (String[])tmpList.toArray(new String[tmpList.size()]);   }   /**    * Dumps given amount of messages from queue to file.    * @param queue The queue to observe    * @param numOfEntries Maximum number of messages to dump    * @param path The path to dump the messages to, it is automatically created if missing.    * @param label A nice queue name for logging/exceptions    * @return The file names dumped, including the path    */   public String[] peekQueueMessagesToFile(I_Queue queue, int numOfEntries, String path, String label) throws XmlBlasterException {      if (numOfEntries == 0)         return new String[] { "Please pass number of messages to peak" };      if (queue == null)         return new String[] { "There is no " + label + " queue available" };      if (queue.getNumOfEntries() < 1)         return new String[] { "The " + label + " queue is empty" };      ArrayList list = queue.peek(numOfEntries, -1);      if (list.size() == 0)         return new String[] { "Peeking messages from " + label + " queue failed, the reason is not known" };      MsgFileDumper dumper = new MsgFileDumper();      if (path == null || path.equalsIgnoreCase("String"))         path = "";      dumper.init(this, path);      ArrayList tmpList = new ArrayList();      for (int i=0; i<list.size(); i++) {         ReferenceEntry entry = (ReferenceEntry)list.get(i);         MsgUnitWrapper wrapper = entry.getMsgUnitWrapper();         if (wrapper == null) {            tmpList.add("NOT REFERENCED #" + i);         }         else {            String fileName = dumper.store(wrapper);            tmpList.add(fileName);         }      }      return (String[])tmpList.toArray(new String[tmpList.size()]);   }   /**    * Command line usage.    * <p />    * These variables may be set in your property file as well.    * Don't use the "-" prefix there.    * <p />    * Set the verbosity when loading properties (outputs with System.out).    * <p />    * 0=nothing, 1=info, 2=trace, configure with    * <pre>    * java -Dproperty.verbose 2 ...    *    * java org.xmlBlaster.Main -property.verbose 2    * </pre>    */   public String usage()   {      StringBuffer sb = new StringBuffer(512);      sb.append(logUsage());      //sb.append("    Bla bla\n");      return sb.toString();   }   public SessionInfo getInternalSessionInfo() {      return internalSessionInfo;   }   /**    * Filled by RequestBroker.java    * @param internalSessionInfo    */   public void setInternalSessionInfo(SessionInfo internalSessionInfo) {      this.internalSessionInfo = internalSessionInfo;   }   /**    * The singleton to handle all topics and its access.    * @return never null (is filled by RequestBroker after construction)    */   public TopicAccessor getTopicAccessor() {      return topicAccessor;   }   public void setTopicAccessor(TopicAccessor topicAccessor) {      this.topicAccessor = topicAccessor;   }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -