Pages

Posted by Prabu on 07:27


JAVA SEPECIFICATION REQUESTs(JSRs)
Daemon Thread and User Thread:
               User Thread is normal Thread. It is not depending on JVM. (Main thread is also a user Thread)
Daemon Thread:
               It is as like as service provider for application. Suppose no user threads are running; only remaining threads are daemon threads. At that time JVM automatically terminates the process.

Similarly, JSR as like as Daemon Thread. It is also service provider for application.
There are over 300 JSR Available.

The JSR is nothing, it is group of API, and it is approved by JCP (Java Community Process).
1) JSR – 162 

Description:

The Portlet API specification defines an API for components being aggregated in web applications like portals. It includes portlets, portlet container behavior, portlet windows, events,  persistent storage and portlet services.
Status:


Reason: Portlet API As there is very significant overlap between JSRs 162 & 167, Sun and IBM have reached a mutual agreement regarding the proposals.
2) JSR—167:  Portlet Specification             Status: Withdrawn





3) JSR – 168 : Portlet Specification              Status : final.
4) JSR—286:
5) JSR—301: Portlet 1.0 Bridge for JavaServerTM Faces 1.2  Statsus:Final
6) JSR—329:  Portlet 2.0 Bridge for JavaServer Faces 1.2 Specification Status :Active
7) JSR—362:  Portlet Specification 3.0  Stauts:Active





Liferary installation in Eclipse JUNO
Installing this in Eclipse:
                      Help--> Install New Software --> and follow the steps.

Installing this in Eclipse:     
               Windows --> Preferences --> Liferay --> Installed Plugin SDKs -->Add --> browse file.

Installing this in Eclipse:
Windows --> Preferences -->Server -->Runtime Environments-->Add àbrowse file.

 Starting a Liferay server
            1) In Server console à right click à new

The home page url is http://localhost:8080


        

Posted by Prabu on 06:16

CORE Spring

1)What is Spring?
   
           Spring is a open source. It is  reverse of JNDI (Java Naming Directory Interface). The trickier part of spring is XML configuration. Now this also made it easily.Through using Annotations. This technique is newly introduce in Spring 3.0 so on.



Features of Spring;
1.      Lightweight                -   less size and less overhead
2.      Inversion of control   -  reverse of JNDI
3.      Aspect-oriented        - Separating the Business logic.
4.      Container                  -  manages the lifecycleFramework        

2)Why we are using spring?
       The beauty of the spring is it reduce the code. The configuration are made in through XML file and annotation (JSR-250). Suppose we need to change the code in program ,it is complex.Here we change  xml configuration file only.


3)Simple code in core java
                  1.spring-config.xml
                  2.Main.java
                  3.Bean.java


Main.java
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
pubic class Main
{
public static void main(String args[])
{
XmlBeanFactory beanfactory = new XmlBeanFactory(new ClassPathResource("springconfig.xml");
Bean beanObj = beanfactory.getBean("Obj");

System.out.println(beanObj.getMessage());
}
}

Bean.java
public class Bean
{
private String message;
 public void setMessage(String message)
{
this.message=message;
}
public String getMessage()
{
return message;
}
 } 
springconfig.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="Obj" class="Bean">
<property name="message" value="Hello Spring World!"/>
</bean>
</beans>


Previous                                                                                                                                              Next