Skip to content

Commit f2ce161

Browse files
author
jefffischer
committed
BroadleafCommerce/QA#1175 - Register an MBean to keep track of create auto.ddl status to avoid multiple schema wipes
(cherry picked from commit 0bd9653)
1 parent 79f4480 commit f2ce161

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* #%L
3+
* BroadleafCommerce Common Libraries
4+
* %%
5+
* Copyright (C) 2009 - 2015 Broadleaf Commerce
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package org.broadleafcommerce.common.extensibility.jpa;
21+
22+
/**
23+
* MBean registered in JMX to keep track of which persistence units are marked with auto.ddl 'create'. The scope of this MBean
24+
* covers the current JVM, which may span more than a single application in the same container.
25+
*
26+
* @author Jeff Fischer
27+
*/
28+
public interface AutoDDLCreateStatusTestBean {
29+
30+
Boolean getStartedWithCreate(String pu);
31+
32+
void setStartedWithCreate(String pu, Boolean val);
33+
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* #%L
3+
* BroadleafCommerce Common Libraries
4+
* %%
5+
* Copyright (C) 2009 - 2015 Broadleaf Commerce
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package org.broadleafcommerce.common.extensibility.jpa;
21+
22+
import java.util.HashMap;
23+
import java.util.Map;
24+
25+
/**
26+
* @see org.broadleafcommerce.common.extensibility.jpa.AutoDDLCreateStatusTestBean
27+
* @author Jeff Fischer
28+
*/
29+
public class AutoDDLCreateStatusTestBeanImpl implements AutoDDLCreateStatusTestBean {
30+
31+
protected Map<String, Boolean> startedWithCreate = new HashMap<String, Boolean>();
32+
33+
public Boolean getStartedWithCreate(String pu) {
34+
return startedWithCreate.get(pu);
35+
}
36+
37+
public void setStartedWithCreate(String pu, Boolean val) {
38+
this.startedWithCreate.put(pu, val);
39+
}
40+
41+
}

0 commit comments

Comments
 (0)