Connection connection = null;
if (joinPoint.getTarget() instanceof Connection) {
connection = (Connection) joinPoint.getTarget();
} else if (joinPoint.getTarget() instanceof MetadataStubExt) {
MetadataStubExt stub = (MetadataStubExt) joinPoint.getTarget();
connection = stub.getConnection();
} else if (joinPoint.getTarget() instanceof ToolingStubExt) {
ToolingStubExt stub = (ToolingStubExt) joinPoint.getTarget();
connection = stub.getConnection();
} else if (Utils.isNotEmpty(joinPoint.getArgs())) {
Object[] objects = joinPoint.getArgs();
for (Object object : objects) {
if (object instanceof IProject && connectionFactory != null) {
try {