static HazelcastInstance getHazelcastInstance ( Vertx vertx ) { VertxInternal vertxInternal = ( VertxInternal ) vertx ; ClusterManager clusterManager = vertxInternal . clusterManager ( ) ; if ( clusterManager != null ) { Class < ? > clazz = clusterManager . getClass ( ) ; Field field ; try { field = clazz . getDeclaredField ( "hazelcast" ) ; field . setAccessible ( true ) ; return HazelcastInstance . class . cast ( field . get ( clusterManager ) ) ; } catch ( Exception e ) { return null ; } } return null ; }
Returns the Vert . x Hazelcast instance if one exists .