Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, 17 October 2012

Building a REST Java web service API using the Spring framework

Building a REST-ful Java web service API has never been more restful than now, using version 3+ of the Spring framework.

 First some annotated Java code:

@Component
@Controller()
public class SampleController {

     @Autowired
     private SampleService service;

     @RequestMapping(value = "/samples/{reference}", method = {RequestMethod.GET})
     @ResponseBody
     public Sample getSampleByReference(@PathVariable String reference) {
          return service.getSampleByReference(reference);
      }
 }

Share:

Thursday, 11 October 2012

Java as a Service - Monitoring the Java Web Service API

One key aspect of managing your public REST web service API is understanding your client usage.

There are several options for doing this, including configuring your IP sprayer to do quota management, or facading your services with a 3rd party service management product like Layer 7 or SOA Software, but you might also consider the very simple Java web service based solution using the open source JAMon library.

The sample code below illustrates a simple per-IP address monitoring solution that you might customise to be per-account or whatever else is available in the HTTP request header.


Share:

Thursday, 4 October 2012

Thursday, 16 October 2008

SaaS and J(2)EE

Introduction

Multitenancy refers to the architectural principle whereby a single instance of software runs on a software-as-a-service (SaaS) vendor’s servers, whilst serving multiple client organizations (tenants). This is in contrast to multi-instance architecture where separate software instance or hardware systems are set up for different client organizations. in other words, under a multitenant architecture, applications are required to virtually partition data and configuration so that each client organization works with a customized virtual application instance. Customization typically includes aspects like user interface branding, access control, data and configuration, workflow, etc
Share:

Wednesday, 8 October 2008

JBoss

I have in the past worked on Websphere and now Weblogic JEE application servers and fortunately never had to port between the two. Just porting from one version of a product to the next is difficult enough, never mind a cross product port! I have found Weblogic to be a fine product, certainly much easier to learn and use than Websphere, but its not cheap, and one of our prospective clients has raised the question of running on JBoss which is of cours open source.

“No problem!” our sales people cry and I wince. JEE is a fine thing in theory and certainly gives you a hope of porting whereas .NET gives you no such hope at all, but the problem is in those little extras that the vendors give you for competition's sake.

So I worry about those JEE implementation variations, some obvious like the Weblogic deployment specific files, some more subtle, like the way CMP works, and I worry about whether JBoss' messaging and clustering will be as tidy as Weblogic's.

So I've downloaded JBoss and will be giving it a go. Hopefully there are some migration guides and even tools out there to simplify my task, but I'm expecting tears and further hair loss.

What's worse is that I'm dying to get rid of all our EJBs, introduce Spring and Hibernate, and run in a servlet container rather than full a blown application server. That would certainly be much more portable, since with Spring you are essentially taking your application container with you. Of course then you are tied into Spring...
Share: