throws CallbackFailedException
{
try
{
DiscoveryDocument disc = DiscoveryDocument.Factory.newInstance( );
EndpointReference epr = null;
InitialContext ctx = new InitialContext( );
prop.clear( );
ResourceadminHome aHome = (ResourceadminHome) ( ctx.lookup( ResourceadminHome.HOME_LOCATION ) );
Map resources = aHome.getResources( );
Collection values = resources.values( );
Iterator iter = values.iterator( );
int size = values.size( );
// If there are the Resources registered to ResourceAdmin build array of their EPRs
if ( size > 0 )
{
EndpointReferenceType[] eprs = new EndpointReferenceType[size];
int i = 0;
while ( iter.hasNext( ) )
{
Object resource = iter.next( );
if ( resource instanceof ApplicationResource )
{
ApplicationResource appResource = (ApplicationResource) resource;
epr = appResource.getEndpointReference( );
System.out.println( "Application " + epr.toString( ) );
}
else if ( resource instanceof HostResource )
{
HostResource hostResource = (HostResource) resource;
epr = hostResource.getEndpointReference( );
System.out.println( "Host " + epr.toString( ) );
}
else if ( resource instanceof IntegrationserverResource )
{
IntegrationserverResource integrationResource = (IntegrationserverResource) resource;
epr = integrationResource.getEndpointReference( );
System.out.println( "Integration " + epr.toString( ) );
}
else if ( resource instanceof BusinessprocesstypeResource )
{
BusinessprocesstypeResource bpResource = (BusinessprocesstypeResource) resource;
epr = bpResource.getEndpointReference( );
System.out.println( "BP " + epr.toString( ) );
}
else
{
throw new Exception( " unknown resource type" );
}
if ( ( epr != null ) && epr instanceof XmlBeansEndpointReference )
{
XmlBeansEndpointReference eprType = (XmlBeansEndpointReference) epr;
XmlObject obj = eprType.getXmlObject( );
if ( obj instanceof EndpointReferenceType )
{
eprs[i] = (EndpointReferenceType) obj;
i++;
}
else
{
System.out.println( "Exception " + epr.toString( ) );
throw new Exception( "Expected type - EndpointReferenceType" + resource.toString( ) );
}
}
else
{