private Asset getAsset ( Object id , String assetTypeToken ) { Asset result = assetCache . get ( id ) ; if ( result == null ) { try { IAssetType assetType = getMetaModel ( ) . getAssetType ( assetTypeToken ) ; if ( id instanceof AssetID ) { AssetID assetId = ( AssetID ) id ; result = new Asset ( Oid . fromToken ( assetId . getToken ( ) , getMetaModel ( ) ) ) ; } else { result = new Asset ( assetType ) ; } setAsset ( id , result ) ; } catch ( OidException e ) { throw new ApplicationUnavailableException ( e ) ; } } return result ; }
Find an asset in the asset cache or create one for this id .