18
18
import com .facebook .presto .spi .connector .ConnectorContext ;
19
19
import com .facebook .presto .spi .connector .ConnectorFactory ;
20
20
21
+ import javax .management .MBeanServer ;
22
+
21
23
import java .lang .reflect .InvocationTargetException ;
22
24
import java .util .Map ;
23
25
import java .util .Optional ;
27
29
public class IcebergConnectorFactory
28
30
implements ConnectorFactory
29
31
{
32
+ private final MBeanServer mBeanServer ;
33
+
34
+ public IcebergConnectorFactory (MBeanServer mBeanServer )
35
+ {
36
+ this .mBeanServer = mBeanServer ;
37
+ }
38
+
30
39
@ Override
31
40
public String getName ()
32
41
{
@@ -45,8 +54,8 @@ public Connector create(String catalogName, Map<String, String> config, Connecto
45
54
ClassLoader classLoader = IcebergConnectorFactory .class .getClassLoader ();
46
55
try {
47
56
return (Connector ) classLoader .loadClass (InternalIcebergConnectorFactory .class .getName ())
48
- .getMethod ("createConnector" , String .class , Map .class , ConnectorContext .class , Optional .class )
49
- .invoke (null , catalogName , config , context , Optional .empty ());
57
+ .getMethod ("createConnector" , String .class , Map .class , ConnectorContext .class , Optional .class , MBeanServer . class )
58
+ .invoke (null , catalogName , config , context , Optional .empty (), mBeanServer );
50
59
}
51
60
catch (InvocationTargetException e ) {
52
61
Throwable targetException = e .getTargetException ();
0 commit comments