package controller;

/*
*  Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
*  WSO2 Inc. licenses this file to you under the Apache License,
*  Version 2.0 (the "License"); you may not use this file except
*  in compliance with the License.
*  You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/
public class controller {

    public void sendUsageData(){


    }

}

@@ -14,16 +14,733 @@
 oller;%0A%0A
+import com.sun.tools.attach.AttachNotSupportedException;%0Aimport communicator.DASPublisher;%0Aimport jvmmonitor.UsageMonitor;%0Aimport jvmmonitor.exceptions.MonitoringNotStartedException;%0Aimport jvmmonitor.model.UsageMonitorLog;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointAgentConfigurationException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointConfigurationException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointException;%0Aimport org.wso2.carbon.databridge.commons.exception.TransportException;%0A%0Aimport javax.management.MalformedObjectNameException;%0Aimport java.io.IOException;%0A%0A
 /*%0A*  Co
@@ -1397,16 +1397,17 @@
 nse.%0A*/%0A
+%0A
 public c
@@ -1434,35 +1434,1155 @@
    p
-ublic void sendUsageData()%7B
+rivate static final String pid=%2233%22;%0A%0A    public void sendUsageData() throws IOException,%0A            AttachNotSupportedException,%0A            MalformedObjectNameException,%0A            InterruptedException,%0A            MonitoringNotStartedException,%0A            DataEndpointAuthenticationException,%0A            DataEndpointAgentConfigurationException,%0A            TransportException,%0A            DataEndpointException,%0A            DataEndpointConfigurationException %7B%0A%0A        while(true)%7B%0A%0A                UsageMonitor usageObj = new UsageMonitor(pid);%0A                usageObj.stratMonitoring();%0A                UsageMonitorLog usageLogObj = usageObj.getUsageLog();%0A%0A                DASPublisher dasPublisherObj = new DASPublisher();%0A%0A                dasPublisherObj.publishMemoryData(usageLogObj.getMemoryUsageLog());%0A                dasPublisherObj.publishCPUData(usageLogObj.getCpuLoadLog());%0A                dasPublisherObj.publishGCData(usageLogObj.getGarbageCollectionLog());%0A%0A            try %7B%0A                Thread.sleep(1000);%0A            %7D catch (InterruptedException e) %7B%0A                e.printStackTrace();%0A            %7D%0A%0A        %7D
 %0A%0A%0A 

Send data frequently to DAS