private void initProtobufMetadataManager(DefaultCacheManager cacheManager, GlobalComponentRegistry gcr) {
ProtobufMetadataManager protobufMetadataManager = new ProtobufMetadataManager(cacheManager);
try {
MarshallerRegistration.registerMarshallers(protobufMetadataManager.getSerializationContext());
} catch (IOException e) {
throw new CacheException("Failed to initialise serialization context", e);
} catch (Descriptors.DescriptorValidationException e) {
throw new CacheException("Failed to initialise serialization context", e);
}
gcr.registerComponent(protobufMetadataManager, ProtobufMetadataManager.class);
registerProtobufMetadataManagerMBean(protobufMetadataManager, gcr, cacheManager.getName());
}