10.03.2013

Spring Scheduling

Use of annotations -  @EnableScheduling and @Scheduled
@EnableScheduling - Enables Spring's scheduled task execution capability. Declare this annotation on @Configuration classes and this enables detection of @Scheduled
@Configuration
 @EnableScheduling
 public class AppConfig {
     // various @Bean definitions
 }
 
@Scheduled - Three flavors 
@Scheduled(fixedDelay =30000)
public void execute() {//Do Something here }
@Scheduled(fixedRate=30000)
public void execute() {//Do Something here }
@Scheduled(cron="0 0 * * * *")
public void execute() {//Do Something here} 
 



Cron expressions

  • "0 0 * * * *" = the top of every hour of every day.
  • "*/10 * * * * *" = every ten seconds.
  • "0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
  • "0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.
  • "0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
  • "0 0 0 25 12 ?" = every Christmas Day at midnight
  • "0 30 14 * * ?"=every day at 2:30 PM

4.26.2012

CLASSPATH

-classpath option with a SDK
Enables you to set the CLASSPATH for each individual application.


CLASSPATH environment variable
CLASSPATH available for all applications by default.

The CLASSPATH environment variable is modified with the set command. 
set CLASSPATH=path1;path2 ...
Wildcard character *
Equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR. For example, the class path entry srb/* specifies all JAR files in the directory named srb.
Subdirectories are not searched


Precede the CLASSPATH with a period(.)
Causes java.lang.NoClassDefFoundError Applies only when the JAR file is in the current directory.

Note:You do not need to reboot. Bring up a new command prompt.


Ref: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html

12.01.2011

WSDL

Web Service Description Language - XML based | Location | Description


Key Elements
types
Data types | XML Schema
message
Data Elements(request & response) of an Operation
porttype Equals to a Class in Java
Description | List of Operations(methods) | Messages(request & response) Involved
binding
Message format | Protocol details

11.30.2011

Java Web Services


Specifications/APIs
JAX-RPC - Specification/API for Java developers to develop SOAP based interoperable web services. This API is now obsolete
JAX-WS - Successor to JAX-RPC. It requires Java 5.0, and is not backwards-compatible to JAX-RPC
JAX-RS - Java API for RESTful web services
SAAJ - API for using SOAP envelopes with or without attachments. It operates on a lower level than JAX-RPC or JAX-WS, both of which will use SOAP envelopes based on SAAJ if needed

Apache Axis/Axis2
Apache CXF
Apache SOAP
JWSDP - Sun Java Webservices Developer Pack, is an implementation of JAX-RPC, SAAJ and various other XML Java technologies. It is now deprecated in favor of the Metro stack.
Metro - Web services stack used in GlassFish?. It supports SAAJ, JAX-WS, WS-Security and other standards.
Jersey - Jersey is the reference implementation of the JAX-RS API, as defined in the JSR-311
GlassFish - Open source reference implementation of J2EE 5 with JAX-WS
Spring Web Services

Web Service

Definitions
  • A service is a software component provided through a network-accessible endpoint. The service consumer and provider use messages to exchange invocation request and response information in the form of self-containing documents that make very few assumptions about the technological capabilities of the receiver.
  • Web services is a computing technique that exploits XML to exchange data or information between computers and computer programs.
  • A Web service is a software component that is described in XML and Web Services Description Language (WSDL). You can access Web services through standard network protocols, typically SOAP over HTTP.
  • A software system designed to support interoperable machine-to-machine interaction over a network.
Platform
 XML + HTTP
Platform elements
SOAP (Simple Object Access Protocol)
           XML based |  Protocol | Platform & Language Independent
UDDI (Universal Description, Discovery and Integration)

           Directory | Register | Search 
WSDL (Web Services Description Languagehttp://srbtechlog.blogspot.com/2011/12/wsdl.html
           XML based | Location | Description


Types of Web Services