Package org.wso2.carbon.logging.appenders

Examples of org.wso2.carbon.logging.appenders.MemoryAppender


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

                .getProperty(LoggingConstants.AppenderProperties.LOG_FILE_NAME));
            fileAppender.activateOptions();
          }

          if (appender instanceof MemoryAppender) {
            MemoryAppender memoryAppender = (MemoryAppender) appender;
            memoryAppender.setCircularBuffer(new CircularBuffer(200));
            memoryAppender.activateOptions();
          }

          if (appender instanceof SyslogAppender) {
            SyslogAppender syslogAppender = (SyslogAppender) appender;
            syslogAppender.setSyslogHost(appenderResource
View Full Code Here

    int DEFAULT_NO_OF_LOGS = 100;
    int definedAmount;
    Appender appender = Logger.getRootLogger().getAppender(
        LoggingConstants.WSO2CARBON_MEMORY_APPENDER);
    if (appender instanceof MemoryAppender) {
      MemoryAppender memoryAppender = (MemoryAppender) appender;
      if ((memoryAppender.getCircularQueue() != null)) {
        definedAmount = memoryAppender.getBufferSize();
      } else {
        return NO_LOGS_MESSAGE;
      }
      Object[] objects;
      if (definedAmount < 1) {
        objects = memoryAppender.getCircularQueue().getObjects(DEFAULT_NO_OF_LOGS);
      } else {
        objects = memoryAppender.getCircularQueue().getObjects(definedAmount);
      }
      if ((memoryAppender.getCircularQueue().getObjects(definedAmount) == null)
          || (memoryAppender.getCircularQueue().getObjects(definedAmount).length == 0)) {
        return NO_LOGS_MESSAGE;
      }
      Layout layout = memoryAppender.getLayout();
      List<LogMessage> resultList = new ArrayList<LogMessage>();
      for (int i = 0; i < objects.length; i++) {
        LoggingEvent logEvt = (LoggingEvent) objects[i];
        if (logEvt != null) {
          String result = layout.format(logEvt);
View Full Code Here

    int DEFAULT_NO_OF_LOGS = 100;
    int definedAmount;
    Appender appender = Logger.getRootLogger().getAppender(
        LoggingConstants.WSO2CARBON_MEMORY_APPENDER);
    if (appender instanceof MemoryAppender) {
      MemoryAppender memoryAppender = (MemoryAppender) appender;
      if ((memoryAppender.getCircularQueue() != null)) {
        definedAmount = memoryAppender.getBufferSize();
      } else {
        return NO_LOGS_MESSAGE;
      }

      Object[] objects;
      if (definedAmount < 1) {
        objects = memoryAppender.getCircularQueue().getObjects(DEFAULT_NO_OF_LOGS);
      } else {
        objects = memoryAppender.getCircularQueue().getObjects(definedAmount);
      }
      if ((memoryAppender.getCircularQueue().getObjects(definedAmount) == null)
          || (memoryAppender.getCircularQueue().getObjects(definedAmount).length == 0)) {
        return NO_LOGS_MESSAGE;
      }
      Layout layout = memoryAppender.getLayout();
      List<LogMessage> resultList = new ArrayList<LogMessage>();
      for (int i = 0; i < objects.length; i++) {
        LoggingEvent logEvt = (LoggingEvent) objects[i];
        if (logEvt != null) {
          Level level = logEvt.getLevel();
View Full Code Here

    int definedamount;
    Appender appender = Logger.getRootLogger().getAppender(
        LoggingConstants.WSO2CARBON_MEMORY_APPENDER);
    PatternLayout tt;
    if (appender instanceof MemoryAppender) {
      MemoryAppender memoryAppender = (MemoryAppender) appender;
      if ((memoryAppender.getCircularQueue() != null)) {
        definedamount = memoryAppender.getBufferSize();
      } else {
        return NO_LOGS_MESSAGE;
      }
      Object[] objects;
      if (definedamount < 1) {
        objects = memoryAppender.getCircularQueue().getObjects(DEFAULT_NO_OF_LOGS);
      } else {
        objects = memoryAppender.getCircularQueue().getObjects(definedamount);
      }
      if ((memoryAppender.getCircularQueue().getObjects(definedamount) == null)
          || (memoryAppender.getCircularQueue().getObjects(definedamount).length == 0)) {
        return NO_LOGS_MESSAGE;
      }
      LogMessage[] logMessages = new LogMessage[objects.length];

      Layout layout = memoryAppender.getLayout();

      for (int i = 0; i < objects.length; i++) {
        LoggingEvent logEvt = (LoggingEvent) objects[i];
        if (logEvt != null) {
          Level level = logEvt.getLevel();
View Full Code Here

                appenderResource.addProperty(LoggingConstants.AppenderProperties.IS_FILE_APPENDER,
                        Boolean.toString(false));
            }

            if (appender instanceof MemoryAppender) {
                MemoryAppender memoryAppender = (MemoryAppender) appender;
                memoryAppender.setCircularBuffer(new CircularBuffer(LoggingConstants.MEMORY_APPENDER_BUFFER_SZ));
                memoryAppender.activateOptions();
            }

            // normally all the appenders inherit from AppenderSkelton
            if (appender instanceof AppenderSkeleton) {
                AppenderSkeleton appenderSkeleton = (AppenderSkeleton) appender;
View Full Code Here

TOP

Related Classes of org.wso2.carbon.logging.appenders.MemoryAppender

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.