Skip to main content
Version: 1.4.x

JMX MBeans

The Extension Point Framework exposes JMX methods and attributes that allow runtime inspection and modification of plugins and extensions without restarting the services. Use these methods mostly when you debug on a local environment; however, you can use them in a production environment in case of an emergency.

Get All Loaded External Plugins​

Use this attribute to determine which external plugins are currently loaded into the service.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFPluginFactory
Class Namecom.elasticpath.xpf.impl.XPFPluginFactoryMBeanWrapperImpl
AttributeAllLoadedPluginIDs

Load Plugin​

Use this method to load a plugin into a running Elastic Path Commerce instance. If the plugin contains extensions with @XPFAssignment annotations, they are automatically assigned to the specified extension points.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFPluginFactory
Class Namecom.elasticpath.xpf.impl.XPFPluginFactoryMBeanWrapperImpl
Methodvoid loadPlugin(String jarUri)

The jarUri parameter must start with file: and specify the location of the plugin JAR on the file system. For example:

file:///Users/jsmith/git/ep-pd/ep-commerce/ep-sample-plugins/blocking-product-sku-validator/target/elasticpath-blockingproductskuvalidator-0.0.1.jar

Unload Plugin​

Use this method to unload a plugin from a running Elastic Path Commerce instance.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFPluginFactory
Class Namecom.elasticpath.xpf.impl.XPFPluginFactoryMBeanWrapperImpl
Methodvoid unloadPlugin(String pluginId)

The pluginId parameter must match the plugin ID as specified in the plugin’s MANIFEST.MF file. For example, elasticpath-blockingproductskuvalidator-0.0.1.

Replace Plugin​

Use this method to replace a plugin in a running Elastic Path Commerce instance. This method is not the same as running unloadPlugin followed by loadPlugin. It ensures that either the old plugin or new plugin will respond to requests, and there will never be a gap where one or the other plugin isn’t loaded and responding to requests.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFPluginFactory
Class Namecom.elasticpath.xpf.impl.XPFPluginFactoryMBeanWrapperImpl
Methodvoid replacePlugin(String oldPluginId, String newJarUri)

The oldPluginId parameter must match the plugin ID as specified in the old plugin’s MANIFEST.MF. For example, elasticpath-blockingproductskuvalidator-0.0.1.

The newJarUri parameter must start with file: and specify the location of the new plugin JAR on the file system. For example, file:///Users/jsmith/git/ep-pd/ep-commerce/ep-sample-plugins/blocking-product-sku-validator/target/elasticpath-blockingproductskuvalidator-0.0.2.jar.

Get All Available Extension Class Names​

Use this method to determine which extension classes are available to be assigned to a specific extension point.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFExtensionResolver
Class Namecom.elasticpath.xpf.impl.XPFExtensionResolverMBeanWrapperImpl
MethodList<String> getAllAvailableExtensionClassNames(String extensionPoint)

Set the extensionPoint parameter to a valid extension point constant from XPFExtensionPointEnum. For example, VALIDATE_PRODUCT_SKU_AT_ADD_TO_CART.

Get Assigned Extension Class Names​

Use this method to determine which extension classes are assigned to a specific extension point.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFExtensionResolver
Class Namecom.elasticpath.xpf.impl.XPFExtensionResolverMBeanWrapperImpl
MethodList<String> getAssignedExtensionClassNames(String extensionPoint)

Set the extensionPoint parameter to a valid extension point constant from XPFExtensionPointEnum. For example, VALIDATE_PRODUCT_SKU_AT_ADD_TO_CART.

Assign Extension to Store​

Use this method to assign an extension class to an extension point, optionally for a specific store.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFExtensionResolver
Class Namecom.elasticpath.xpf.impl.XPFExtensionResolverMBeanWrapperImpl
Methodvoid assignToStore(String extensionClass, String pluginId, String extensionPoint, String storeCode, int priority)
  • Set the extensionClass parameter to the fully-qualified class name of an extension class. For example, com.elasticpath.plugins.blockingproductskuvalidator.extensions.BlockingProductSkuValidator.
  • Set the pluginId parameter to the plugin ID of the plugin providing this extension class. For example, elasticpath-blockingproductskuvalidator-0.0.1. If the extension class is embedded within the Elastic Path Commerce source code, then leave this empty.
  • Set the extensionPoint parameter to a valid extension point constant from XPFExtensionPointEnum. For example, VALIDATE_PRODUCT_SKU_AT_ADD_TO_CART.
  • Set the storeCode parameter to the store code of the store that this extension should be available in. To assign the extension to all stores, leave this empty.
  • The priority parameter indicates the priority of the extension for the extension point.

Remove Extension from Store​

Use this method to remove an extension class from an extension point, optionally for a specific store.

Parameters​

ParameterValue
Object Namecom.elasticpath.xpf:name=XPFExtensionResolver
Class Namecom.elasticpath.xpf.impl.XPFExtensionResolverMBeanWrapperImpl
Methodvoid removeFromStore(String extensionClass, String pluginId, String extensionPoint, String storeCode)
  • Set the extensionClass parameter to the fully-qualified class name of an extension class. For example, com.elasticpath.plugins.blockingproductskuvalidator.extensions.BlockingProductSkuValidator.
  • Set the pluginId parameter to the plugin ID of the plugin providing this extension class. For example, elasticpath-blockingproductskuvalidator-0.0.1. If the extension class is embedded within the Elastic Path Commerce source code, then leave this empty.
  • Set the extensionPoint parameter to a valid extension point constant from XPFExtensionPointEnum. For example, VALIDATE_PRODUCT_SKU_AT_ADD_TO_CART.
  • Set the storeCode parameter to the store code of the store that this extension should be excluded from. To remove the extension from all stores, leave this empty.