Monday, October 30, 2017

Garbage collection

Singleton in same package same class,


package com.singletone.test;


class SingletoneBorn{

private static SingletoneBorn instanse = new SingletoneBorn();

private SingletoneBorn(){}

public static SingletoneBorn getInstanse() {
return instanse;
}

public void showDetails(){
System.out.println("This is singletone born world");
}
}

public class SingletoneTest {

public static void main(String args[]){
SingletoneBorn sb = SingletoneBorn.getInstanse();
sb.showDetails();

}


}

Singleton same package different class


Singleton class

package com.singletone.test;

public class SingletoneTest {


private static SingletoneTest instanse = new SingletoneTest();

private SingletoneTest(){}

public static SingletoneTest getInstanse() {
return instanse;
}

public void showDetails(){
System.out.println("This is singletone born world");
}

}

Singleton usage class

package com.singletone.test;

public class TestSingletone {
public static void main(String args[]){

SingletoneTest st = SingletoneTest.getInstanse();
st.showDetails();
}


}

Singleton different package different class


Singleton class

package com.singletone.test;

public class SingletoneTest {


private static SingletoneTest instanse = new SingletoneTest();

private SingletoneTest(){}

public static SingletoneTest getInstanse() {
return instanse;
}

public void showDetails(){
System.out.println("This is singletone born world");
}

}

Singleton usage class

package com.singletone.test2;

import com.singletone.test.SingletoneTest;

public class SingleTest {

public static void main(String args[]){
SingletoneTest st = SingletoneTest.getInstanse();
System.out.println("Singletone method call in nother package");
st.showDetails();
}




}

Sunday, October 29, 2017

How to create http proxy service in Wso2 ESB

Now we are going to explain about how to create http proxy service and call it to with client side.


Configuring Wso2 ESB to route messages through a proxy server


Edit the <ESB_HOME>/repository/conf/axis2/axis2.xml file, and add the following parameters in the <transportSender> configuration of the http transport:
  • http.proxyHost - The host name of the proxy server.
  • http.proxyPort - The port number of the proxy server.

You can see like this code when you set above parameters. 

<transportSender name="http" 
   class="org.apache.synapse.transport.passthru.PassThroughHttpSender">    
    <parameter name="non-blocking" locked="false">true</parameter>
    <parameter name="http.proxyHost" locked="false">localhost</parameter>
    <parameter name="http.proxyPort" locked="false">8080</parameter>
</transportSender>


Create proxy service using Wso2 Developer Studio.




Friday, October 27, 2017

How to create proxy service using WSO2 ESB (Call Using Soap UI)

If you don't have idea about how to install wso2 esb for your PC follow this link.

I'm going to explain how to create proxy service using wso2 developer tool.

Here is I only  added log mediator inside the proxy service. Now expose the car app

Lets go to the admin console panel. Here you can see bellow things.

  1. Proxy URL
  2. wsdl file

Click this wsdl link. You can see wsdl file inside the another tab. Copy that wsdl link.

Now we need to create SOAP project. Open soap UI.
Create new soap project using copied link.


Tuesday, October 24, 2017

How to includeHTML page into another HTML page

I'm going to include content.html file inside main.html,

content.html file


<html> 
  <body>
    <div id="new-projects">
    <a href="howto_google_maps.asp">Google Maps</a><br>
    <a href="howto_css_animate_buttons.asp">Animated Buttons</a><br>
    <a href="howto_css_modals.asp">Modal Boxes</a><br>
    <a href="howto_js_animate.asp">Animations</a><br>
    <a href="howto_js_progressbar.asp">Progress Bars</a><br>
    <a href="howto_css_dropdown.asp">Hover Dropdowns</a><br>
    <a href="howto_js_dropdown.asp">Click Dropdowns</a><br>
    <a href="howto_css_table_responsive.asp">ResponsiveTab</a><br>
    </div>
</body>
</html>



main.html file


<html lang="en">
<head>
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
 <script>
$(document).ready(function() {
$('#result').load('content.html #new-projects', function() {
//alert("loaded");
});
});
 </script>
</head>

<body>
   <b>Projects:</b>
<div id="result"></div>
</body>

</html>





You need to include both file in same folder. Otherwise you have to change inside the load() method.


Run this as localhost/path/main.html

Friday, October 20, 2017

How to debug java class inside the class mediator in Wso2 Enterprise Integrator(EI)

Before I do this I created API including class mediator.


Deployee car file including all file(Here I only included Esb Solution project).


Go to integrator.bat file location(<ESB_HOME>/bin) in command prompt and run bellow line.


integrator.bat -debug 5005     (Here you can enter any port what you need).


After this go to java class.


Select Run in menu bar -> Debug Configuration.. ->Right click on Remote Java Application in the left side

     ->New ->Enter  5005 popup window port location ->click Debug

Description Images



Image_01
sdwad




















Image_02


When Finished command prompt run statement you will able to see like this line 
as usually
 INFO - CarbonUIServiceComponent Mgt Console URL  : https://192.168.120.160:9443/carbon/ 

After this send request your API. Then You can see debug mode in the java class.
Thank you

















Wednesday, October 18, 2017

Creating a .jar Deployment Package Using Maven and Eclipse IDE (Java)

In this tutorial, we will show you how to use Maven build tool, to create a single executable Jar.

Right click maven project,

choose Run As-> Maven Build ...

Type package in the Goals box.

Click Run.