Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

flights

Air Force Names Its Death Machines After Charlie Sheen and Battlestar Galactica [Odd]
Thursday, 24 March 2011 20:20
Charlie Sheen isn't an F-18, but he is an EC-130 cargo plane specially configured for psy-ops. Some EC-130 flights over Libya have been going by the call-sign "SHEEN"— as in, "SHEEN 53, what's your altitude?" Other flights are "CYLONs." More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/KZ6npVL5CVo/air-force-names-its-death-machines-after-charlie-sheen-and-battlestar-galactica

 
This A380 Montblanc Pen is Only For the Wealthiest of High-Flyers [Pens]
Monday, 10 January 2011 07:40
Want this Montblanc Skeleton pen, shaped like an Emirates A380 plane? Those 28 diamonds, 18-carat gold plating and lure of winning free flights will never be yours—unless you fork-out $19,335 for it. [AMEinfo via Moodiereport via BornRich] More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/mG6_XN9KeEU/this-montblanc-pen-is-only-for-serious-high+flyers

 
Happy Holidays and Free In-flight Wi-Fi From Google [Free]
Monday, 08 November 2010 10:20
Just like last year, Google is paying the Wi-Fi of all passengers flying with AirTran Airways, Delta, and Virgin America. From November 20 to January 2, 2011, all domestic flights will have free Gogo Inflight Wi-Fi. [Free Holiday WiFi] More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/vizRnXsqfo4/happy-holidays-and-free-wi+fi-from-google

 
Spring : Practical use of Spring method cache
Saturday, 12 June 2010 11:37
Here is practical use of Spring method cache.Example is using Ecache with Spring cache annotation
(Please refer to this nice article about how to configure spring method cache - http://www.dzone.com/links/r/how_to_enable_a_method_cache_with_the_springframe.html)

We have a web-app for online air ticket booking .This App gets data from integrated partner airlines systems .
For example each partner airlines exposes REST to know available flights for a date between Source and Destination .And they also expose REST to book a ticket .

Web Application use case is like that -

1.Use comes to our website ,searches flights available for a Date between a Source and Destination
2. then she selects a flight and books ticket .

Step 1 - is tricky as we have to show all flights available for that Date between source and destination and this Data has to come from each partner airlines system.That means if we have 100 airline partners we have to make 100 REST (1 REST call to each airline )calls and have to wait long enough for data
to come from integrated airlines partner systems .This might take a long response time and user experience wont be nice .

Might be you have already noticed - Data here is Flights between a source and destination for a Date .Each Airline would configure flights for a Date and would rarely change it .So Step 1 is classic case of method cache.

We can consider these rules to populate flight data into cache -
1.Run a cron job to populate Flight Data into cache for routes those have high number of flights .
2.For routes having few flights we would populates cache when some web user first searches flight for that route .

For step 2 - User selects a Flights so we already know partner airline system's url and directly make REST call to that system .[This is easy and direct one ]

let see code now for a method cache -


public interface FlightSearchService {


//If data is already there in cache it would take it from there otherwise make a REST call to partenr airlines //systems and then keeps it in cache for
//whole day as crone job would run in midnight

@Cacheable(cacheName="flightCache", keyGeneratorName="flightSearch")
public List getFlights(Date date,City source,City Destination);


}

Now lets write a cacheUpDate method for to update Flights Data into flightCache


public interface ManagerFlightCache {
//This method should be called by some kind of crone job -say- it runs in midnight and collects all Flight //data for a month from all partner
// airlines system

@TriggersRemove(cacheName="flightCache", removeAll=true)
//this removeAll=true would first remove all cached data from flightCache
public void updateFlightCache(Date fromDate,Date toDate);
}


Here is our keyGenerator for flight cache

//This KeyGenerator referred as "flightSearch" referred in @Cacheable
public class MethodArgsConcatKeyGenerator implements CacheKeyGenerator {

public Serializable generateKey(MethodInvocation methodInvocation) {

return concatMethodArguments(MethodInvocation methodInvocation); }

}
private String concatMethodArguments(MethodInvocation methodInvocation){
StringBuilder key = new StringBuilder();
for(Object arg : methodInvocation.getArguments()){
key.append(arg.toString()+"-");
}
return key.toString();
}


With cache being populated every midnight for routes having too many flights Data -searching flights become real fast .If some one searches for flights beyond one month (cache is populated with Flights for one month) then it would make REST call to partner airlines systems and then Data would be put in the cache .

During midnight crone job would run (it would call updateFlightCache(date1,date2) to remove data already present in cache ).Method would first invalidate cache (remove flight Data from cache ) and then collect Data for one month(for busy routes only) ,this way it would capture any changes occured in flights (more flights might be added by a airline or removed ).

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/8A9NgmzuexI/11607

 


Taxonomy by Zaragoza Online