Book Image

Service Oriented Java Business Integration

Book Image

Service Oriented Java Business Integration

Overview of this book

Table of Contents (23 chapters)
Service Oriented Java Business Integration
Credits
About the Author
Acknowledgement
About the Reviewers
Preface

JBI Proxy Sample implementing In-Compatible interface


In the second sample on JBI Proxy, we will make a simple but significant change in the interfaces implemented. We will create a JBI proxy implementing an interface incompatible to the target service. Then, in place of the target service we will use the proxy instance. Then any calls intended to the target service will be first routed to the proxy and the proxy in turn will delegate the call to the target service. The structural relationship between various classes participating in the interaction is shown in the figure:

In the above figure, you might have noticed that even though we use two completely different types (IEcho and ITarget) as the interfaces, the methods declared in these two interfaces are the same in every respect. This is a hack we want to introduce intentionally. In other words our aim here is to invoke the method in TargetService. But, we want to do it through the proxy only. We want the proxy to be created implementing...