File tree 6 files changed +9
-9
lines changed
service-locator/src/main/java/com/iluwatar 6 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
- package com .iluwater ;
1
+ package com .iluwatar ;
2
2
/**
3
3
* Service locator pattern, used to lookup jndi services
4
4
* and cache them for subsequent requests.
Original file line number Diff line number Diff line change 1
- package com .iluwater ;
1
+ package com .iluwatar ;
2
2
3
3
/**
4
4
* For JNDI lookup of services from the web.xml. Will match name of the service name that
@@ -16,10 +16,10 @@ public class InitContext {
16
16
*/
17
17
public Object lookup (String serviceName ){
18
18
if ( serviceName .equals ("jndi/serviceA" ) ){
19
- System .out .println ("Looking up service A and creating new serivce for A" );
19
+ System .out .println ("Looking up service A and creating new service for A" );
20
20
return new ServiceImpl ("jndi/serviceA" );
21
21
} else if ( serviceName .equals ("jndi/serviceB" ) ){
22
- System .out .println ("Looking up service B and creating new serivce for B" );
22
+ System .out .println ("Looking up service B and creating new service for B" );
23
23
return new ServiceImpl ("jndi/serviceB" );
24
24
} else {
25
25
return null ;
Original file line number Diff line number Diff line change 1
- package com .iluwater ;
1
+ package com .iluwatar ;
2
2
3
3
/**
4
4
* This is going to be the parent service interface which we will
Original file line number Diff line number Diff line change 1
- package com .iluwater ;
1
+ package com .iluwatar ;
2
2
3
3
import java .util .HashMap ;
4
4
import java .util .Map ;
Original file line number Diff line number Diff line change 1
- package com .iluwater ;
1
+ package com .iluwatar ;
2
2
3
3
/**
4
4
* This is a single service implementation of a sample service. This is the actual
Original file line number Diff line number Diff line change 1
- package com .iluwater ;
1
+ package com .iluwatar ;
2
2
3
3
/**
4
4
* The service locator module.
5
- * Will fetch service from cache, otherwise creats a fresh service and update cache
5
+ * Will fetch service from cache, otherwise creates a fresh service and update cache
6
6
*
7
7
* @author saifasif
8
8
*
You can’t perform that action at this time.
0 commit comments