Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Set<Integer> getDefaultItemIds( Integer gender ) throws MtvException {
- Element inventoryElement = inventoryCache.get( gender );
- UserInventory defaultInventory = null;
- if ( inventoryElement == null || inventoryElement.isExpired( ) ) {
- logger.debug( "Default inventory has expired. Retrieving new inventory from the MPPS server." );
- try {
- defaultInventory = mtvIntegrationUtil.getDefaultInventory( gender );
- inventoryElement = new Element( gender, defaultInventory );
- inventoryCache.put( inventoryElement );
- } catch ( MtvException e ) {
- logger.debug( "An exception was thrown getting the default inventory. put something in the cache so it doesnt block" );
- inventoryElement = new Element( gender, new UserInventory() );
- inventoryElement.setTimeToLive( 1 );
- inventoryCache.put( inventoryElement );
- throw e;
- }
- } else {
- logger.debug( "Default inventory has not expired. Using cached data" );
- defaultInventory = (UserInventory) inventoryElement.getValue( );
- }
Add Comment
Please, Sign In to add comment